echo the_modified_date('j/M/Y') in after_title
-
Hi,
I want to add a “last updated date” in a span inside a specific widget
here’s my function so farfunction add_front_sidebar(){ register_sidebar( array( 'name' => 'Front Sidebar', 'id' => 'front-sidebar', 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '<span class="last-update">Last Updated: ' . the_modified_date('j/M/Y') . '</span></h3>' ) ); } add_action('widgets_init', 'add_front_sidebar');
I have two issues:
1. I can’t get the_modified_date to echo out
2. Is there away to target the corrected<span class="last-update">Last Updated: ' . the_modified_date('j/M/Y') . '</span>
to only appear in a certain widget, in this case the widget title is What’s NewThanks
- The topic ‘echo the_modified_date('j/M/Y') in after_title’ is closed to new replies.