Tagged: blog page, single post
Hi,
I’m using the “elegant blog layout” and added in loop-index.php this code snippet; it shows, when a post has been updated:
if(strtotime($post->post_modified) - strtotime($post->post_date) > 86400) {
echo "<span class='aktualisiert'>(aktualisiert: ",
the_modified_date('j. M. Y').')</span></span>';
}
It should appear only at the bottom of a single post – so far, so good, it works: http://screencloud.net/v/juON
I have added this code snippet in the loop-index.php at line 207-209:
http://pastebin.com/5xnZ6zku
The problem is:
it shows this “updated time” also at the blog page below the excerpt and the “read more” button:
http://screencloud.net/v/jSNs
Could you please tell me, where exactly in the loop-index.php I can place the code snippet mentioned above,
so that it appears only in single post, but not at the blog page under each post preview/excerpt?
Thank you.
Hi COLORIT!
Surround it with this.
if ( is_single() ) {
}
Best regards,
Elliott
Wow, great, that works perfectly, thank you Elliott!!