WP Categories and Posts

  

WP Categories and Posts now has a new page and author. Please visit the new WP Categories and Posts Page on the Phill McDonnell website.

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:

Here is a screenshot as well.

Categories and Posts Screenshot

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.


Other RA Project Articles



If you like this article, please consider signing up for RA Project Daily Updates via email or directly to the RA Project RSS Feed http://feeds.feedburner.com/RAproject. Thank you!






48 Comments on “WP Categories and Posts” - Add yours!

  1. Excellent job Ronald! :) I will have to use this on my site also.

    Thanks for sharing it with everyone. :)

  2. 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.

  3. Clean, simple and extremely useful. Thank you so much!!!

  4. John,

    I’m glad you found it useful. Thank you.

  5. 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.

  6. 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!

  7. 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.

  8. Thanks for replying. Okay, the sitemap.php is in my Themes directory. But I’m not sure how to create a page template.

  9. 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 :)

  10. 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

  11. Wow! Thanks! No problem. I like your plugin and I’m going to write about it in my other blog. =)

  12. GOOD WORKED

  13. 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?

  14. 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.

  15. I justed tested this plugin on WP 2.3 RC1 and everything works fine. This plugin should be compatible with the new release.

  16. Ronald..thanks for checking the new RC!

  17. John,

    Yeah, to be honest, I’m surprised it still worked :)

  18. With the changes in the database schema, I am afraid several of my plugins, notably EventCalendar3 are not going to survive the upgrade.

  19. Hi! Is there a parameter to limit the number of post displayed (like the last N posts) ?

    Thanks for your great work!
    Andrea

  20. 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.

  21. 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?

  22. 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:

    $output .= $parent . "\n<ul>" . $parentPosts . "\n</ul>";

    to this:

    $output .= "\n<ul>" . $parentPosts . "\n</ul>";

    I apologize that there isn’t a more elegant solution.

  23. Nuts. I need the link on my site map but I don’t want it on another template. Thanks for the prompt response!!

  24. 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.

  25. Ronald…sweet patch. Does exactly what I was looking for. Props and my thanks!!

  26. Great plugin! How can I stop the date from being shown?

  27. 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.

  28. @lex et al,

    My apologies, but this plugin is no longer updated. Anyone is free to take it over.

  29. hey, i need to know how it is possible to show only the post titles without the following date!

    thanks a lot.

  30. Nice plugin. :neutral: I am using Clean Archives. Now i am gonna try this one. Thanks.

  31. Is it possible to say only show the 3 most recent posts from each category? Thanks!

  32. @All,

    There is a new developer on board for this plugin. I will point him to this post to get an idea of what the user base is wanting as far as features.

    I foresee in the near future (as soon as the plugin is added to WP Extend) that this post will automatically redirect to the new plugin author’s site.

    Take care,

    Ronald

  33. I am trying to order posts that appear within each category alphabetically. By default, it is ordering by date. But I can’t get it to change. Please assist?

  34. Please note that this plugin has a new author.

    Please visit the new page for WP Categories and Posts.

    Please allow a few days for the transition.

    Comments will now be closed for this post.

Trackbacks/Pingbacks

  1. WordPress and WordPress Plugins » Reader Appreciaton Project - 24. Mar, 2007

    [...] grown” plugins that are suited to benefit readers. The first such plugin is called WP Categories and Posts. The plugin enables blog authors to easily set up a sitemap that lists all of the categories (and [...]

  2. Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 3/26 - 26. Mar, 2007

    [...] WP Categories and Posts is an extension of the wp_list_categories. Instead of listing just categories, the plugin lists the post under the each category as well. This is very useful for a sitemap. [...]

  3. links for 2007-03-26 at L’urlo del coniglio - 26. Mar, 2007

    [...] WP Categories and Posts » Reader Appreciaton Project (tags: plugins wordpress) [...]

  4. New Wordpress Plugins Released 26 March 2007 » TheSMSGuide Blog » Blog Archive - 26. Mar, 2007

    [...] WP Categories and Posts is an extension of the wp_list_categories. Instead of listing just categories, the plugin lists the post under the each category as well. This is very useful for a sitemap. [...]

  5. WeblogToolsCollection Español » Blog Archive » Plugins de WordPress publicados 26/3 - 27. Mar, 2007

    [...] WP Categories and Posts es una extensión de wp_list_categories. En lugar de listar solamente las categorías, el plugin también lista las entradas dentro de cada categoría. Este plugin es sumamente útil para la elaboración de un mapa de sitio. [...]

  6. links for 2007-03-28 en newdisco - 31. Mar, 2007

    [...] WP Categories and Posts » Reader Appreciaton Project Plugin de WordPress que te permite mostrar las categorias listadas pero con sus respectivos articulos entre medio. Ideal para sitemaps. (tags: wordpress plugin plugins sitemap categories) [...]

  7. Untwisted Vortex - Living in a Different Land » WP Plugins: Exec-PHP, Smart Archives, and WP Categories and Posts - 31. Mar, 2007

    [...] 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. [...]

  8. WP Plugins April 4, 2007 « Blogtology - 10. Apr, 2007

    [...] WP Categories and Posts is an extension of the wp_list_categories. Instead of listing just categories, the plugin lists the post under the each category as well. This is very useful for a sitemap. [...]

  9. Devlounge | Friday Focus #29 - 04. May, 2007

    [...] Simple Yearly Archive Plugin is very similar to the Clean Archives plugin. Both allow you to display your posts categories by year and offer different display options. For a way to show your archives by categories, check out a plugin called Categories and Posts. [...]

  10. WordPress Plugins I Use - Untwisted Vortex - Living in a Different Land - 21. May, 2007

    [...] WP Categories and Posts – I wrote about this before in my WP Plugins: Exec-PHP, Smart Archives, and WP Categories and Posts article and referenced it in other articles. My Extended Categories page is based on it. [...]

  11. WP Plugins DB » Plugin Details » WP Categories and Posts - 04. Jul, 2007

    [...] Visit [...]

  12. 1guy » Custom 404 for Wordpress - 31. Jul, 2007

    [...] a small bit of code snipped from the wordpress codex, a great plugin from the raproject and a copy of your default 404.php you can help viewers find what they were looking for (and then [...]

  13. Case Study: Ajax Edit Comments and Technorati » Reader Appreciation Project - 12. Oct, 2007

    [...] was all for it, and I released my second WordPress plugin called Categories and Posts. The plugin was fairly popular and brought in some links, which was nice. My ultimate goal was to [...]

  14. Link Frenzy: Backlink Bonanza #5 - 11. Jan, 2008

    [...] at Reader Appreciation Project linked his WP Categories and Plugins plugin page to my categories page as an example of the "plugin in [...]