• Hello

    On my website, on the left sidebar, there is a list of all recent posts. I would like to display something like ‘Last updated Feb 01 2014 at 5.24pm’ above the list.

    On category pages, the sidebar contains just the latest posts from that category. I would want the same ‘Last updated’ message but only applying to that category.

    And finally on tag pages, the sidebar contains the latest posts from each tag. Here I would like the same message but applying just to that tag.

    I would really appreciate some guidance with this!

    Thank you!

    pad

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pad11

    (@pad11)

    (Oh and this is a hand-coded theme, I am familiar with WordPress and its normal functions and a good understanding of PHP as well.)

    Thread Starter pad11

    (@pad11)

    Any ideas?

    I found this:

    function site_last_updated($d = '') {
    	$allposts = new WP_Query();
    	$allposts->query('orderby=modified&cat='.get_query_var('cat').'&paged='.$paged);
    	if ( $allposts->have_posts() ) {
    		$allposts->the_post();
    		$last_update = the_modified_date($d);
    		echo $last_update;
    	}
    	else
    		echo 'No posts.';
    }

    This code works to show the last update time for categories.

    But how about seeing when a tag was last updated?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Echo "Last updated" time for specified/current category’ is closed to new replies.