Category Posts Widget 3.0

This latest update introduces a few new features:

  • Support for WordPress 2.9′s post thumbnails.
  • Option to show the post date.
  • Option to show the comment count.
  • Option to set the word length of the excerpt.

Note that support for Simple Post Thumbnails has been removed in favor of the built in functionality.

You can download the plugin at the WordPress plugin repository: Download here.

Please donate if you find this plugin useful.

Update: Several people have been reporting an error “Warning: Invalid argument supplied for foreach()…” I just pushed out version 3.1 which should fix this. This bug could have been fixed if I had done some more rigorous testing. I’ll do better next time.

About thumbnails: Many people have been wondering why the thumbnail options don’t show up. This is because your theme does not support thumbnails! See Mark’s post to enable them.

163 thoughts on “Category Posts Widget 3.0

  1. fyi, with the update i’m getting this error:

    Warning: Invalid argument supplied for foreach() in /home/.saber/paperpetual/paperpetual.com/wp-content/plugins/category-posts/cat-posts.php on line 15

  2. Category Post text on widgets all of a sudden got huge. don’t know what happened.

    I installed the update and no luck on a fix

    too bad, I loved this feature

    wish I knew what happened

  3. Thanks, the first plugin that works as promised. But I was happy with version 2.3 because the integration with Simple Post Thumbnails was very successful. Could provide an opportunity for those who use it continue using in the future whilst enjoying the new features?

    Incidentally, I believe that the new version are not working the excerpt length

  4. Great plug-in, saves the day.

    I however suggest a fix at cat-posts.php at line 87: instead of the_time(‘j M Y’), use the_date() to honor WordPress date format config.

    ref: codex.wordpress.org/Template_Tags/the_date

  5. hi. great plugin ! in version 3.1, show thumbnail (in admin widgets section) is missing.. why?

  6. Just found out about your plugin, but for the life of me I can’t figure out how to make the thumbnails work. Using 2.9.1 WordPress with Thesis. In the config settings there is no option for thumbnails??? Is it located somewhere else?

  7. Your theme has to support the new post thumbnails feature in order for the option to appear. You can do this by adding the following line to your theme’s functions.php file:

    add_theme_support( 'post-thumbnails' );
  8. OK, inserted add_theme_support( ‘post-thumbnails’ ); to custom_functions for Thesis. I then had the thumbnail info available on the widget settings. I set thumbs to 100×75, saved and I do not get the thumbs to view. Any thoughts on what I can do next? Thanks again James!

    -Darren

  9. Darren, the only thing I can think of is that you didn’t add thumbnails to your posts which you can do on the post edit page in the right sidebar.

  10. I found that even if you had thumbnails set up before, you have to go back into your posts, and use the NEW wp 2.9 thumbnail setting option (right side of sidebar inside wp-admin area).

    Would be cool if this had a check box option to use the old way or the new 2.9 way.

  11. about what theme do you talk, james ?? is in admin section wordpress the problem!! not about a specific theme..

  12. Hi James, great plugin! But I’m having some issues with it. :)
    When I activate plugin, and then try edit uploaded images (with new image editor in wp2.9), I don’t get full image preview, only part of image, but dimensions are accurate.
    If I deactivate plugin, then it works fine. Any ideas?
    Thanks.

  13. Hi James

    I have a problem. I would like the excerpt text to appear next after the thumbnail, not at the bottom of it. The thumbnail appears at left, so I want the text to be at right, but I`m not able to do this. If you could help me…

    Thank you, good job

  14. Thanks Brett so much for pointing this out! (about the new WordPress 2.9 Thumbnail upload for each post)

    It’s a pain in the butt to have to upload all the Thumbnails again through WordPress Media Library and “set as Thumbnail” but at least they’re showing up now!!

    Cheers
    Jane

  15. Hi: Like your widget – but having issues with the thumbnail placement. It seems to place the image under the text excerpt instead of next to it (like to the left) Any ideas on how to adjust?

  16. Love the plugin but can’t figure out how to style the placement of the thumbnail. It shows up but it is to the right of the post text. I would like it to the left with a little padding and the text to be middle aligned to the right. Any input on how I can make this adjustment? Thanks in advance!

  17. Also having the same problem with the excerpt length… any idea why this isn’t functioning properly? it’s just showing the full post. Thanks!

  18. Help. Got the stylesheet issue resolved and love the plugin but for some reason it is only showing 10 posts, not 12, etc. I want to be able to show as many posts and define the limits but even with it set to 0 it shows only the top 10 posts. If I set it to 12 it ignores that setting and shows the latest 10 posts. Any help would be greatly appreciated. Thanks!

  19. I’m sorry however, I do not see the function for the images/thumbnails

    I also looked to place ‘add_theme_support( ‘post-thumbnails’ );’ into functions.php and since it isn’t really clear whether this is to be placed within the themes functions.php or MU’s functions.php…

    Could someone be a little more succinct as to how to implement this fix… thank you

  20. I am having the same problem as Len – my thumbnail images were displaying fine (left-aligned) before the WordPress 2.9 upgrade, and now are displaying straight after the post title or under it, depending on the length of the post title.

    http://saucybeige.com/WLH/snooping/

    James, could you please give any tips on how to modify the plugin?

    I’ve tried doing it through the Style Sheet but with no luck…

    Thanks
    Jane

  21. This one would had been interesting for me if it was not only possible to use as a widget, but also directly on pages and posts.

    List Category Posts does this, but for some strange reason I cannot get all the short code parameters to work. Also, it lacks the thumbnail feature.

    http://wordpress.org/extend/plugins/list-category-posts/

    If you are thinking about the next step for this plugin, consider making it available for pages/posts as well. Would make a good plugin even more versatile and useful.

  22. Any clue as to how to get the text to wrap the image? I moved the code so that at least the image now appears below the Title and Data but that big huge gap of air there…

    Great plug-in which is more than can be said about a lot of others….

    Any ideas, on how to get <p style=align textleft or right for that matter?

  23. I am using Category Posts Widget 3.1 and really like it. BUT when I check “Make widget title link” it does NOT display the “Title” until the mouse hovers over the Title bar and then it is displayed in a very lite white. HOW can this be changed so that the “Title” is displayed exactly as it would be without this option and then shows as a link when the mouse hovers over it? In my case the Title bar is a dark color with white letters.

  24. James, I've just tried out your Category Post Widget. My site is quite new, and I'd been posting since around Christmas. I hadn't been doing any categorizing at all until this weekend, though; and after catching right up to my latest entry, I realized that no categories were being displayed on the site, despite the work of doing so much categorizing.

    When I began configuring your widget, it displayed the very first category of my categories in the category drop-down box, so I thought that I must have to “configure and save” for every category listing I have. So I did so.

    But my site still has no category display — just a list titled 'Important Information' displaying 10 post headings; and further down, a 'Featured' area with an excerpt of one of my posts.

    What has bothered me about my site is that not only is there no full category display, but the post titles show randomly. That is, iIf any page of the site is refreshed, the post titles listed in the 'Important Information' will change to a new collection of titles.

    I am at a loss on how to get this straightened out.

    The way it is now, there is no rhyme nor reason to the site. Anyone coming to it will have no idea what posts may be buried away in it, apart from the 10 titles on display. They may think that there is nothing else in the site. Heck, I don't even know how to locate any of the other posts, apart from refreshing a page over and over and hoping the post title will randomly appear in the 'Important Information' list.

    But no one else is likely to know that this can be done to see a new set of post titles. And why would anyone bother, even if they did know? It's just too haphazard, and doesn't lead to anything specific.

    The hope was that your widget would bring order to the chaos, but the challenge seems far too formidable.

    Any suggestions at all?

    Thanks.

  25. Hello

    I like your plugin ! But I want to control the style and don't understand where is the stylesheet.. ? I desperately search the <class=”cat-post-item”> and <class=”post-title>…

    Thanks for your help

  26. Hi James. Thanks for a great plugin. The problem I'm experiencing is that the post links are not aligning with the category title in the sidebar; any idea why this should be so? It's for a small non-commercial site I'm setting up for a friend who's a painter.

    Thanks for your time

  27. I installed the plugin and set up my category. When you click on the post from the widget it goes to my about page and not the post. Any ideas?

  28. HI, I am using category post and I am trying to embed flash video. the video shows fine on the single post page but doesn't show on the sidebar. Is there something that I need to add?
    Thanks

  29. The widget only shows an excerpt which strips out any Flash video. This is something WordPress does automatically.

  30. Oddly, it seems that this plugin has reversed the display order of my posts. It used to be the newest at the top, now it's the oldest at the top. Bit weird, eh.

    I did go through my published posts and add a new category for the posts that I want your plugin to pick up, then I went through and stickied some of those posts. Could that have been the reason for this?

    Gary

  31. Update. I see what happened. The sticky posts (which are older-dated) appear at the top. So it was nothing to do with your plugin. I bet you knew that already!
    Cheers.
    Gary

  32. Hi James, I love your plug-in, thank you. Really great that it uses the new wordpress thumbnail function.

    I would like to be able to turn the post title on and off in different instances of the widget. I'm using it in some cases where I just want thumbnails but other cases where I want news titles.

    I know how to comment out the title for all instances but is there a way I could add in a variation so I can choose whether or not to display the post title?

    Thanks

  33. @lena – I needed to sort out the posts and simply added a few parameters into a query, find the line:
    $cat_posts = new WP_Query(“showposts=” . $instance["num"] . “&cat=” . $instance["cat"])

    It wasnt an elegant solution but works perfectly for my purposes, check my version:

    $cat_posts = new WP_Query(“showposts=” . $instance["num"] . “&cat=” . $instance["cat"] . '&orderby=title&order=asc');

    This is quic'n'dirty one, You can change the last parameter into some conditional logic, which should be pretty straightforward here :)

  34. James,

    Seems like a lot people would like to know how to change the position of image. For example have the image first follow by Title. Can you please give us a hint.

  35. Great plugin, works perfectly. BUT – can I edit the amount of space between the post title, date and post excerpt? Too much space at the moment.