WordPress Plugin to display all posts in all categories

I knocked up a quick plugin to display all the categories and display all the posts in each of them. Currently it displays posts multiple times in each of the categories it belongs to. I had to jump through hoops a bit to get the categories ordered alphabetically.

See it in action here.

Available from the WordPress.org plugins repository.

Update: version 1.2 just out adds the ability to set the ordering of the posts.

The idea originated with my friend Linda at herselfswebtools.com.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Comments

  1. Very nice. Is it going to be able to list post in a specific category?

  2. Hi,

    It shows all the categories as headings in alphabetical order with a list of all the posts in each category (date ordered, as a link to the post). Posts that are in more than one category will appear under all of those headings.

    To give a clear idea, here’s what it looks like on this site:
    http://www.jameswilkesdesign.co.uk/web-design-tutorials/

    james
    PS I like linuxbsdos.com

  3. Great tool! Any idea how to modify so that the posts sort in order of alpha instead of date for a true alpha index? Thanks!

  4. Hi,

    I’ve used your plugin to create a site index at http://funeral-poems.net/funeral-poems-site-index/ and several other sites.

    It would make more sense in my context to have the posts in alphabetical order as well as just the categories.

    Is it possible for me to change your plugin so that it lists posts alphabetically, and if so, can you point me in the right direction please.

    Thanks.

  5. Hi,
    Sorry for the slow reply. I’ve been working at Glastonbury Festival and just got back late last night with flu! Give me a couple of days to get back on my feet and I’ll get this done. Thanks for your feedback.

  6. I was looking for just this thing to create a site map for my blog based on categories rather than dates, or worse, just a list of posts. Thank you so much!!!!

  7. Thanks for the plugin – I use it at http://www.webtermine.at/termine/nach-hinzufugedatum-sortiert/ to show the recent changes on our site. Is there a way to also display the publishing date? I tried to modify your code ($post_date) but didn´t succeed. Any help would be really appreciated!

  8. I found the solution :-)
    [...]
    $pdate = mysql2date(‘j. M Y’, $post->post_date);
    [...]
    $postlist[$postlink] = array($postname, $categories, $pdate);
    [...]
    $postlisttext .= “”.$postdata[2].”: ” . $postdata[0] . “\n”;

  9. Great plugin – would have been much more versatile if I could exclude or include specific categories though.

  10. Hi Karl,

    Nice suggestion. Just implemented it in v1.3:

    http://wordpress.org/extend/plugins/complete-post-list-by-alphabetically-ordered-categories/

  11. This is a great plugin, exactly what I needed! Thank you!!!

    Is there a way to limit it to a certain number of posts in the category? For example, I only want to show the three most recent posts in the “exercise” category. Also, is there a way to not show the category name in the list?

    Thanks again!

  12. One more question:

    Is there a way to add an except below the post title? Like a mini teaser…

    Thank you!

  13. does it support pagination? ex. if i display the 5 newest post,how do i get the link to the older post?
    thanks

  14. @Allyson: I’ve replied by email and included a replacement php file which should do all three of the things you’ve listed.

    @manik_arum: it displays a list of every post in every category by default – it is designed to give a nice index page of the whole site rather than wordpress’ pagination.

  15. Hi James, thanks you for the very useful plugin. (Which actually makes a nice looking list when produced contrary to other plugins I’ve seen.)

    Would you be able to tell me how I can get the categories to be listed NOT alphabetically, but by whatever order I have them set to by default? (I use a plugin called “Category Order” which allows me to rearrange the order categories are displayed. After setting the order with that plugin, wherever categories are displayed (such as in the sidebar widget) the categories are listed in this order. I’d like it displayed with your plugin in the same way without forcing it to be alphabetized.

    Also, perhaps an option to list the date next to the particular post (and number of comments) would be nice — especially if we could choose to include that information or not.

    Thanks for your time!

  16. Admin or Allyson,
    Could you email me the php file with the ability to restrict the number of posts per category?
    Thanks

  17. @Paul: Hi Paul, I’m not familiar with the Category Order plugin. I’ll see if I can find a way to do that.

    @Richard: On it’s way.

  18. Great plugin, I’ve been using it successfully for some time. It seems that since the WordPress 3 upgrade, on some (not all) pages I’m getting the error message: “Warning: stripos() [function.stripos]: Offset not contained in string in /home/bricksla/public_html/wp-content/plugins/complete-post-list-by-alphabetically-ordered-categories/jw-catpostlist.php on line 35″. Is this an incompatibility with WordPress 3, or is there somewhere else I should be looking? Thanks!

  19. Hmm, curious. Is this is occuring only on pages where you are using the plugin?

  20. This is a great plugin, and I’ve been using it for a couple of months. One question: Is there a way to include the text of the post beneath each post title? Or at least part of the post text?

    For example, something like this:
    [catlist id=9 date=yes numberposts=8 posttext=yes]

    With perhaps a linebreak or something between the posts so they don’t look all jumbled up.

  21. You can find more info about error here:
    http://wordpress.org/support/topic/plugin-category-post-list-error-message-on-some-posts

    Thank you for this plugin.
    Cheers

  22. Hi Steve,
    This seems like a common request. I’ll look at putting it in on the next release.

  23. Using this plugin at http://förståsigpåarna.se (swedish site).

    I’m using WP 3.0.1 and everything seems to work. But there is a bug. You’ll need to add: if (strlen($content) < $i + 15) return $content; between row 34 and 35. Or you'll might run in to an offset warning.

    Some stuff that would be really good to include in the plugin: Show post date, show other categories for the listed post. Order and list the post not by title but a custom post field.

    At our site we review movies. Would be great to order the list acording to movie title (which isn't the same as the title of our review). We also put the movies in multiple categories according to genre. So what we would like is a page that list all reviews in order of movie title. Showing the date the review was added (and forgot to mention it – the author of the post) and a list of categories the movie belongs to (i.e "Night of the Hunter – 11/11 2010 by Bobo (Film-Noir, Moives, Horror, Thriller")).

    If you're swarmed up, I could fix it myself and give you the modified source.

  24. Hi James, I love the plugin! It’s simple but effective. I have a similar request to Allyson’s – I wanted to limit the number of posts for certain categories. Could you also kindly send me the file that’ll help me do just that? I would appreciate it greatly. Thank you again!

  25. Hi there, I can’t get the plugin to work with the qtranslate plugin I’m using. It doesn’t handle the shortcode well, I think. There is something that might be useful here, but it doesn’t mean a lot to me: http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=294

  26. Sorry, I’ve been out with the flu for a while so there’s been a big break in my responding to comments.

  27. @Bobo: hi. Can’t see a circumstance where this would fail. What was the content in your post? As for extra features, I’m keeping the plugin simple. It does what 98% of people want from it. Making software completely flexible for everyone is a nightmare, it gets far more complex, harder to debug and harder to maintain. You sound like a developer yourself so I’m sure you know what I mean! I’m looking for good films to watch over christmas so I’ll be checking your site out for recommendations. Cheers!

    @John: I’ve made the changes I sent to Allyson available at: http://www.jameswilkesdesign.co.uk/files/jw-catpostlist_Allyson.zip

    @James: Sorry for the slow reply. What is the result in the webpage when both plugins are activated?

  28. I just started getting the error message: “Warning: stripos() [function.stripos]: Offset not contained in string in /home/bricksla/public_html/wp-content/plugins/complete-post-list-by-alphabetically-ordered-categories/jw-catpostlist.php on line 35″.

    I am using Wp 3.03 noticed the error on pages only. Surfaced while I was setting up a PhPurchase shopping cart.

    Hopefully you can help because I love your plug-in and use it on several sites.

  29. Hello James

    I want to thank you for your support on this plug-in. I love how the plug-in helps in the overall navigation of my site and was sad that adding a shopping cart to my site started causing errors and thought that I may be forced to decide between having the shopping cart or the Category Post List plug-in. But because of your excellent support and taking the extra time to help me, I can have both! Now I can proceed with my new site just the way that I had hoped too. Thank you, Thank You, THANK YOU!

  30. Thanks Dave. I really appreciate that. Good luck with your new site!

  31. I don’t understand your instructions. When you say
    “Put this tag into your posts or pages where you want the list:
    [jwcatpostlist]”

    Do you mean litteraly put these letters:
    [jwcatpostlist]
    on a page and then upload it?

    Or do you mean that it should be wrapped around a certain php code block?

    Thanks, Arlene

  32. Hi Arlene. Yes, I mean to literally put [jwcatpostlist] in the page or post when you’re editing it. It’s a common way for putting plugins into a page for things like video players and galleries. Try it! I love WordPress because it’s quite hard to break it. You can play around without much risk of things going wrong.

  33. Why yes. Your plugin works beautifully. Thank you so much.

    I was messing around with my page templates and didn’t realize that I needed a loop in the template to make the contents editable through wordpress. That’s why it didn’t work for me at first.

    Have a great new year!

  34. hi james.

    great little plugin which i use to list all the bands i’ve ever photographed. looks great, although i wonder if there is any way to output a bold, uppercase A, B, C, D, E etc etc in between the posts alphabetically?

    so, using your plugin, the list would look like this:

    A

    • Ash Grunwald @ the Gov, May ’09
    • Augie March @ A Day On The Green, January ’09

    B <and so on, throughout the alphabet)

    • Barry McGuire @ the Gov, March ’09
    • Ben Harper & Relentless7 @ Adelaide Oval, November ’09

    Your plugin works perfectly already at my site, check it in use here: http://www.bjwok.com/list-of-bands/ but i do think it needs these uppercase, bold letters to help separate and breakup the list a little.

    Any help would be totally appreciated!

    cheers bud :)

  35. It appears the plugin is no longer working properly! Is there an update?

  36. Upgraded to version 1.4 and worked… now not working again…
    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in D:\Hosting\2777628\html\WPNWOSavers\wp-includes\meta.php on line 319

  37. Hi James thanks you for this plugin. I have a question is there a way to only show the list of one category and sort it by date ascending.

    Can you please help me I am a newbie here…

    Thanks

  38. Hi James!

    Your plugin works OK. Thank you.
    But my webpage works with subcategories.
    I like a list cascade post title… that is a my problem!
    Help me and another peoples!

    Thank you and sorry my english speech!

  39. Hi James. Thank you for this plugin.
    Could you tell me how can I include the shortcode in php file? For example in index.php. I want to use it in the main page on my site, replacing content of the original index.php file with your shortcode.
    Thanks in advance.

  40. Hi James, appreciation from Hong Kong! : )
    Thanks for your work. Your plugin is so nice!
    I wonder if I can add in more than one list on one page. I want two lists shown in different places on my page. When I insert the second code, it just shows up like text. What will you suggest?
    THANKS!

  41. Hello James,

    thank you this is exactly what I have been looking for. I have a crazy thought to have each post in the category show a pop up cloud when you hover over the post. I do a recipe site and it would be nice to see quick read of each post. Email me if this doesn’t make sense.

    Thanks

  42. Hello James,

    I installed your plugin it worked great the first day then it started giving “Fatal error: Out of memory (allocated 66584576) (tried to allocate 42 bytes) in /home/wp-includes/cache.php on line 421″

    Do you have a solution for me? any help would be appreciated.

    Thanks

  43. Love the plug in! It’s exactly what I’m looking for. This is a temporary URL until I migrate my blogger site.

    Question:
    How do I change the formatting of the text?

    I want the category font to be Header 6
    I want the post titles to be the paragraph font

    Can you help me with this? I really appreciate it!

    -Kirsten

  44. Sorry folks, paid work has been coming in so unpaid work on plugins has had to be sidelined.

  45. Hi James!
    very great easy plugin!
    i saw your last post! ok…but if you found an easy way to show the list of category and sort it by date..please help me!
    thank you thank you thank you!

    Alex

  46. Hey I love your plugin, and it works really well.

    One feature request I have is an ability to define how many posts to display.

    My apologies if this is already there and I didn’t notice it, I did look.

  47. @alex: Not yet Alex, when I get time to work on it I’ll bear that in mind as a feature.

  48. I’m using WP V 3.2.1
    Any clues why this plugin borks up the edit page in the dashboard?

    any page with the jwcatpostlist shortcode does not show up in the edit page , only partially loads page and shows nothing

    Thanks
    Great plugin

  49. Spent hours fiddling with php to try to do this, then found your plugin. THANK YOU! Like others, I’m patiently waiting for you to spend all your free time creating options. ;) I’m looking for a way to add the date along with the title, and the first few lines to each post so that it looks similar to the format you see in the default wordpress blog. But besides that, I’m not sure how to get an answer when it’s posted here, other than checking back every day, which I know I will forget to do. If it doesn’t automatically come to me, would be endlessly greatful if you (James/admin) can let me know when the features I’m looking for are added. My email is: contactus at practicalwaystosavemoney.com – Thanks again!!

  50. Hi James,

    Is there a way to run the plugin from a sidebar, or alternatively call it directly from PHP so I can manually add this to my template?

    Jonathan

  51. Is that possible to use multiple “jwcatpostlist” in a page?
    Example:
    [jwcatpostlist includecats=1]
    [jwcatpostlist includecats=2]
    [jwcatpostlist includecats=3]
    This seems not working.

  52. I have some reason so that I can’t use
    [jwcatpostlist includecats=1,2,3]
    to implement my page :(

  53. Only one category displays when using the tag [jwcatpostlist]. When using the tag [jwcatpostlist includecats=4,5,6] the same category above is the only one listed. What am I doing wrong?

    On website, see menu item Life Tools–>>Quotes Link List

    Thanks.

  54. Can you email me the php to limit the number of post shown

  55. Sorry folks, life has got ridiculously busy and I haven’t got any time to work on this.

    @pete, that’s really strange, can’t think of any reason.

    @GoodGirl, thanks!

    @Jonathan, it would take a little bit of hacking the code to do that. I’m sorry but I haven’t got any time for it at the moment (I’ve only got time to answer comments because I’m sick)

    @sul3nog, I’m sorry, you can only put one in a page. I didn’t think when I wrote it that it would be useful to have multiples but I guess it is useful.

    @bob, looks like it’s fixed?

    @Jason, I’ll include this in an update at some point when I’ve got time. Might be a while.

  56. I love your plugin. I’m just wondering if you can order the post listings by “slug”? I’m using the plugin on this page:

    http://themaingallery.org/clay-s-wolf/

    Thanks,

    Julie

  57. @Jonathon, I’m running the plugin through a sidebar:

    http://www.jameswilkesdesign.co.uk/wordpress-plugin-to-display-all-posts-in-all-categories/

    You can just move it into your sidebar from the “widgets” section.

  58. Hi James…

    Your plugin looks AWESOME and easy to implement :)

    I’m a php noob though. I’m having a problem limiting the list to just one SUBcategory though… I tried [jwcatpostlist includecats=25 orderby=title order=asc ] wherein the “25″ is the single category I want to list on the page, but the entire category ‘tree’ shows up on my page.

    Can I just include one sub-category to show as a list? Or as long as it’s a sub-category (even if the parent category isn’t selected for that post), the entire list will still show?

    Thanks :)

  59. Sorry, specifically, it’s this page:

    http://www.ninjagolego.net/buy-ninjago-toys/ninjago-spinners/

    I only want the LIMITED EDITION ITEM and the SPINNERS to appear on that Page.

    Spinners has a category ID of 25

  60. UPDATE

    OK found the issue, of course its a PHP setting …
    Seems that available script memory is the issue.
    After looking at the system messages, I saw it was running out of Allowed Memory ….
    Odd that this is the only plugin that this happens with, but at least I found it.

    Updating php.ini to allow more memory solved this issue in its entirety. (both editing and blank page issues)

    Currently working happily with WP 3.2.1 (and a lot of other plugins too)

    Another side effect is that any page the shortcode is on, will cause the connection to have issues and a Blank page will be displayed with no data on it

Leave a Comment