views:

23

answers:

1

I want to show the time of the last blog update at the header of my wordpress blog. It's not the last update time of a post but rather any post or page (i.e. any last update done in the blog)

e.g. Format:

Now: Tuesday, March 16, 2010 | Last Update: 6:09 PM ET

Is there any template tag to accomplish this?

A: 

I don't know of any template tags that can do this, but you can access the database directly and find the "newest" post or page. Try something like this (I have no wordpress-installation available for test right now):

<?php $newest = $wpdb->get_row("select post_modified from $wpdb->posts 
where post_type in ('page', 'post') and post_status = 'publish' order by post_modified desc");
 echo mysql2date('m/d/Y',$newest->post_modified);
 ?>
windyjonas