Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add a "last updated date" in a span inside a specific widget here's my function so far

function 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 Last Updated: ' . the_modified_date('j/M/Y') . ' to only appear in a certain widget, in this case the widget title is What's New

Thanks

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.