How to use the WP Plugin List Category Post widget (!) with more than one category?

The Plugin List Category Post used as shortcode in a post/page allows to display a number of random posts from several categories.

But when I use the plugin's widget I can choose only one category.

Is there a way to use the widget and allow to choose several categories?

Topic plugin-list-category-post Wordpress

Category Web


You can use these shortcodes:

This will show posts that are in Categories 17 AND 25 AND 2

[catlist id=17+25+2]

OR

This will include post that are from any of categories 17 OR 24 OR 32

[catlist id=17,24,32]

You can also us catlist name in the same way:

[catlist name=sega+nintendo]  
[catlist name=sega,nintendo]

I have it in use on my site like that:
eg:

[catlist id=191+199, orderby=date order=dec numberposts=10 Date=yes]

191 = a country category and 199 = latest news category.


Unfortunately, the widget for this rather slip-shod plugin seems to have been built as an afterthought, and doesn't appear to do what you require. There's really no excuse for not directly supporting the plugin, and I'd advise against using this one.

That said, if you must, try adding the following to your functions.php:

add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');

Then use a standard text widget instead of the plugin widget. Within that text widget, add the desired shortcode.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.