The PHP code for the last 5 posts
-
Hello,
Can someone please help me with this?
This is the problem:
On my frontpage (www.klifix.nl) I have insert to my sidebar the last 5 posts on the frontpage.
I also want the last 5 posts of movies.klifix.nl & radio.klifix.nl on my frontpage to appear.
The question is: How do have to edit the following php-code to do this?The code:
<?php
$today = current_time(‘mysql’, 1);if ( $recentposts = $wpdb->get_results(“SELECT ID, post_title FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date_gmt < ‘$today’ ORDER BY post_date DESC LIMIT 15”)):
?>-
<li id=”recents”>
-
<?php
- <font color=#000099><b>* </b></font>ID’>”;
the_title();
echo ‘
foreach ($recentposts as $post) {
if ($post->post_title == ”)
$post->post_title = sprintf(__(‘Post #%s’), $post->ID);
echo ”‘;
}
?><?php endif; ?>
- <font color=#000099><b>* </b></font>ID’>”;
- The topic ‘The PHP code for the last 5 posts’ is closed to new replies.