Hi,
I would like to show the date of the last update of a post and got this code snippets, that I have to put into the loop-index.php.
As I am not a coder, could you please tell me exactly the place in the loop-index.php, where I have to place this:
// LAST UPDATE of the post
if ( is_single() ) {
if(strtotime($post->post_modified) - strtotime($post->post_date) > 86400) {
echo "<div class='aktualisiert'>(Letzte Aktualisierung des Artikels: ",
the_modified_date('j. M. Y').')</div>';
}
}
This part should be in the same line as the post-meta-infos “date – category – comments – author”!
Note:
I use ENFOLD v4.4, the default business blog layout, not the “elegant” blog layout, and my single posts are using the normal WP editor, not the ALB, if this is important to know.
Thank you.
Hey Gitte,
If you plan to replace the published date with last date modified then you can find this code (line 241):
echo ““;
and replace it with:
echo "<time class='date-container minor-meta updated' >".the_modified_date('j. M. Y')."</time>";
if not you can place your code after this code (line 272):
echo '</span>';
Hope this helps.
Best regards,
Nikko
works fine, thank you.