"Modified Date" after Content

Posted in: Newspaper
Post count: 159

Hi,
where’s the best place in template-files to put “the_modified_date(‘M j, Y’);” direct after the content?
single.php or td_module_1.php or something else…

Post count: 780

Hello,
I would recommend to use the_content filter:
https://forum.tagdiv.com/how-to-add-ads-in-front-of-and-behind-the-contents/

Post count: 159

OK, got it. Not the nicest solution cause I’m not a programmer:

function modified_date($content) {
$content = '' . $content . esc_html( 'aktualisiert am ' ) . esc_html( get_the_modified_date()  );
$content = '' . $content . esc_html( ' - ' ) . esc_html( get_the_modified_time("h:i")  );
return $content;
}
add_filter('the_content', 'modified_date');

Maybe someone else could use and improve it

  • This reply was modified 12 years by mbasche.
  • This reply was modified 12 years by mbasche.
  • This reply was modified 12 years by mbasche.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.