WP Categories and Posts
WP Categories and Posts is an extension of the core WordPress function called wp_list_categories. This plugin adds in a template tag you can use to display categories and sub categories and the posts underneath those categories.
For working examples, please see the following pages:
- Reader Appreciation Project Sitemap
- Ronalfy.com Sitemap
- Books Love Me Sitemap
- Untwisted Vortex Extended Categories
Here is a screenshot as well.

Download
Please download the file WP Categories and Posts v1.0.
Installation
Installation is simple. Just unzip into your plugins folder and activate the plugin. From there, you may call the function ronalfy_list_categories_and_posts() from within your WordPress page.
An example page template called sitemap.php is included in the zip file. You can copy this file into your themes directory and use it as a page template for your sitemap if you wish.
Usage
The function by itself will return the categories and posts. It will accept most of the same arguments as wp_list_categories, but not all of them. One argument that I noticed that didn’t work was showcount.
Support
This plugin is provided as is, but I will try to answer most of your questions in the comments. Thank you.





Bes says...
Excellent job Ronald!
I will have to use this on my site also.
Thanks for sharing it with everyone.
Ronald Huereca says...
You’re welcome Bes. Let me know if you have any problems with the implementation. It should just be a simple function call and some added styles into your stylesheet.
John P. says...
Clean, simple and extremely useful. Thank you so much!!!
Ronald Huereca says...
John,
I’m glad you found it useful. Thank you.
David Evans says...
This was exactly what I spent hours looking for, but it doesn’t work for me:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 341251 bytes) in
I shouldn’t have to increase memory allocation.
Also, how about some documentation and examples?
I want to create a page and list specific categories, with the titles of each entry linking to the archive page.
Should be simple, it’s not. Hopefully your plugin can do this.
Josette says...
Hi there,
This might be a useful plugin for me but I can’t find the sitemap page anywhere! Can you explain more? Would appreciate it!
Thanks!
Ronald Huereca says...
David,
Since this plugin is just an extension of a WordPress template tag, you’ll find the documentation at the WordPress codex site for wp_list_categories. As stated above in the “Usage”, not all of the same arguments will work, however.
Josette,
A sample sitemap.php template is included in the zip file. You must copy this file over to your theme directory and set up a new page using this file as a template. You can find more about this at WordPress pages.
Josette says...
Thanks for replying. Okay, the sitemap.php is in my Themes directory. But I’m not sure how to create a page template.
Ronald Huereca says...
Creating a page:
In your WP Dashboard, click on “Write”. After that, click on “Write
Page”. On the right side, there is a thing called “Page Template”.
There should be a drop down where you can select “Sitemap”. If
Sitemap isn’t there, it’s possible that the sitemap.php file was
copied to the wrong theme folder.
I hope that helped
Ronald Huereca says...
Josette,
I added a link to your sitemap as an example. I hope you don’t mind. If any one else has working examples, I’d be happy to add a few more example links.
Thanks,
Ronald
Josette says...
Wow! Thanks! No problem. I like your plugin and I’m going to write about it in my other blog. =)
maxNLO says...
GOOD WORKED
John P. says...
Still love this plugin. I foresee a day where my site map will be a scrolling nightmare as the months and years go by. Maybe an AJAX implementation which could collapse/expand the index for posts older than a certain date?
Ronald Huereca says...
Hey John,
That’s a good suggestion. I didn’t really plan on releasing updates to this, but that would be really cool to have. I have a few more projects on the pipeline, but I’ll definitely see what I can do (or can’t do). It may be a while (a few months), so keep in touch.
Ronald Huereca says...
I justed tested this plugin on WP 2.3 RC1 and everything works fine. This plugin should be compatible with the new release.
John P. says...
Ronald..thanks for checking the new RC!
Ronald Huereca says...
John,
Yeah, to be honest, I’m surprised it still worked
John P. says...
With the changes in the database schema, I am afraid several of my plugins, notably EventCalendar3 are not going to survive the upgrade.
Andrea says...
Hi! Is there a parameter to limit the number of post displayed (like the last N posts) ?
Thanks for your great work!
Andrea
Ronald Huereca says...
Andrea,
I have one more plugin to write before I visit this plugin again, but when I do, I’ll be sure to add something like this in.
John P. says...
Ronald…I’m trying to suppress the category name/link and just show the list items of the category. I passed the “title_li=” argument in your function but it didn’t seem to work. Any ideas?
Ronald Huereca says...
John,
I’m afraid you’re going to have to edit the raw code. If I’m interpreting what you want correctly, you want to change line 126 from this:
to this:
I apologize that there isn’t a more elegant solution.
John P. says...
Nuts. I need the link on my site map but I don’t want it on another template. Thanks for the prompt response!!
Ronald Huereca says...
John,
I sent you an e-mail last night with a modified version that will allow you to do what you want to do. Hopefully it didn’t end up in your spam box.
John P. says...
Ronald…sweet patch. Does exactly what I was looking for. Props and my thanks!!
Mark says...
Great plugin! How can I stop the date from being shown?
lex says...
I would also like to know how to remove the date and how to prevent the main parent category from showing up before each child category.
Ronald Huereca says...
@lex et al,
My apologies, but this plugin is no longer updated. Anyone is free to take it over.
purose.cn says...
Have a test!
Thank you!
It is a great plugin!