Return to Snippet

Revision: 11143
at January 26, 2009 08:16 by davebowker


Initial Code
<?php global $wpdb;
$queries = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_type='post' ORDER BY post_date DESC LIMIT 1 ");
$date = $queries[0]->post_date;global $post;
$post = get_post($post);
$time = $post->post_date;
if($date == $time) {
	echo "<img class='ico-new' src='";
	bloginfo('template_url');
	echo "/images/new.png' alt='' border='0' />";
}?>

Initial URL

                                

Initial Description

                                

Initial Title
Wordpres, query for the latest post

Initial Tags
post, wordpress, query

Initial Language
PHP