Hi guys,
I’ve got a kirby site which is not coded by me.
The site only loads on localhost the title, then this snippet
children()->;visible() as $section) : ?>; $section)) ?>;
$site)) ?>
and after that the imprint. The code which should load the content looks like this:
<? foreach ($site->children()->visible() as $section) : ?>
<? snippet('elements/section', array('data' => $section)) ?>
<? endforeach ?>
This is in the home.php. Even when I remove the whole code in home.php the site still shows the same. What’s wrong with that?
Don’t use PHP short tags (apart from the short echo tag <?=
, change like this:
<?php foreach ($site->children()->visible() as $section) : ?>
<?php snippet('elements/section', array('data' => $section)) ?>
<?php endforeach ?>
It’s really weird. For example I changed the code from
<? snippet('header) ?>
to
<?php snippet('header') ?>
In the source code chrome shows me still
<? snippet('header') ?>
and doesn’t actually load the snippet.
Have you made sure to change it everywhere?
Do a search and replace in your entire project.
The fact. that. php. code. is rendered as text in the page is a typical result of using short php tags if they are not enabled (and shouldn’t really be used or enabled).
I literally replaced every single one. In the source code it still gives me the ‘wrong’ home.php
Hm, send me a zip of the project if you want, I’ll have a look.
1 Like
Sent you an email at info@texniq.de
For reference, the cache was on, so changes weren’t reflected; in addition to the use of short tags, the code itself was also a bit too short with almost all the echo statements missing…