Template tags error: recent posts
-
Hi. I’ve been having a problem with some template tags. What I’m trying to do is show the 5 most recent posts in descending order by date and with permalinks. Oddly enough, I got this to work just fine- no errors or anything. I achieved it just by tweaking the code I got from the WordPress Codex pages on this subject. But for some reason (quite unapparent to me), none of the main page text is loading at all. The template displays just fine, and the footer, header, navigational bar… but the text just isn’t there. Can someone help? Maybe you’ll be able to spot what’s causing the problem. Here is my code:
<ul>
<?php $posts = get_posts('numberposts=5&offset=0&orderby=post_date&order=DESC');
foreach ($posts as $post) : start_wp(); ?><li><?php the_date(); echo ""; ?><a>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
- The topic ‘Template tags error: recent posts’ is closed to new replies.