The date in the post summary.
-
I have no idea whether I’ve implemented WP strangely into my site or not, and I have to keep it brief…
I’ve used this code:
<?php
$how_many=5; //How many posts do you want to show
require_once(“blog/wp-config.php”); // Change this for your path to wp-config.php file ?>
<ol id=”new_post”>
<?
$news=$wpdb->get_results(“SELECTID
,post_title
FROM $wpdb->posts
WHEREpost_status
= \”publish\” ORDER BY ‘ID’ DESC LIMIT “.$how_many);
foreach($news as $np){
print (”- <a href=\””);
echo get_permalink($np->ID);
print (“\”>$np->post_title
“);
} ?>This summarises the posts, but is it possible to add a line or two to display the date, without turning the way I’ve implemented it into my site on it’s head.
I’d be grateful for any feedback! ??
- <a href=\””);
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘The date in the post summary.’ is closed to new replies.