How to display latest posts from a specific category without a plugin in WordPress
I’ve just made an addition to my side bar that displays all of the latest items added to my SEO jobs category. It’s a few, simple lines of code and doesn’t nessecary warrant an entire plugin! Here’s how to do it – just insert the code below, and change the
category=1 argument to the category number of your choice:
$myposts = get_posts('numberposts=5&offset=1&category=1');
foreach($myposts as $post) :
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
The problem I’m trying to solve is why this job is not displaying on the list even though it’s in the same category as all the others.
I’m off to play with Ubuntu Intrepid Ibex now. expect a report, soon!