Hi,
I am using the Recent Posts Function wp snippet from this site. But i’ve been trying to figure out how to call the time stamp next to each post. Here is the function:
<?php
function recent_posts($no_posts = 10, $excerpts = true) {
global $wpdb;
$request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type=’post’ ORDER BY post_date DESC LIMIT $no_posts";
$posts = $wpdb->get_results($request);
if($posts) {
foreach ($posts as $posts) {
$post_title = stripslashes($posts->post_title);
$permalink = get_permalink($posts->ID);
$output .= ‘<li><h2><a href="’ . $permalink . ‘" rel="bookmark" title=" ‘ . htmlspecialchars($post_title, ENT_COMPAT) . ‘">’ . htmlspecialchars($post_title) . ‘</a></h2>’;
if($excerpts) {
$output.= ‘<p>’ . stripslashes($posts->post_excerpt);
}
$output .= ‘</p></li>’;
}
} else {
$output .= ‘<li>No posts found</li>’;
}
echo $output;
}
?>
I know there must be a simple fix, but nothing is working for me… Please and thank you!!