WP Last Posts v1.1
Monday, September 24th, 2007
My WP Last Posts plugin was pretty buggy. It interfered with tings like searching (getting weird results for pages it was used in). It made me think, try, fail, think of something else, try that and fail again. Apparently, a loop inside page content just doesn’t work right.
So I regret to announce that this plugin will no longer insert posts inside pages. It now simply offers a template tag that can be put anywhere inside your template. You could now for instance display the excerpt from the last post in your sidebar. Or simply display some post excerpts underneath the page content using a custom page template.
Hi Colin,
I’m using your plug-in just as you mentioned with great success. Thanks so much for providing this.
Is there any way to specify which category posts get pulled from?
Thanks again!
Edward
Not by default. There is nothing to prevent you from changing the code however.
On line 23, you’ll find
$lastPosts = get_posts('numberposts='.$numberOfPosts);Change that to
$lastPosts = get_posts('category=N&numberposts=’.$numberOfPosts);Substitute N for the category ID you wish the posts to be taken from (you can find it through WP Admin > Manage > Categories).
Yup, that did it! Thanks Colin.