Using post_date outside "The Loop"
-
Hi all,
I’m trying to use post_date outside “The Loop” as I want to display latest posts on my index page as well as in my blog section.
I’m using the following code:
$data = mysql_query("SELECT * FROM wp_posts ORDER BY post_date DESC LIMIT 0, 5") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { Print "<tr><td width=988><li><a href='website.com/news/?p=".$info['ID'] . "'>".$info['post_title'] . "</a> <font color=#666666><i> - posted on ".$info['post_date'] . "</td></tr>"; }
However the problem is that it appears like so:
- Post Title – posted on 2010-11-05 02:02:51
rather than - Post Title – posted on 05.11.10
(the latter is how it appears in the actual blog index)Can anybody help me out here?
Thanks in advance ??
- Post Title – posted on 2010-11-05 02:02:51
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Using post_date outside "The Loop"’ is closed to new replies.