How To List Category Posts Via Shortcode In WordPress ?

You can display category posts inside your WordPress site pages and posts via shortcode. This way you can create some pages showing posts from a featured category in a stylish and easily accessible way.

For example: Suppose you have a ‘News’ category and a few sub news categories and you want to create a special page showing your news category and its sub category articles on one page which can be accessed from yourwebsite.com/news or something like that. This can be easily done by creating a ‘news’ page and displaying all news category articles via shotcode.

How To List Category Articles Via Shortcode ?

First install-activate List Category Posts plugin and then start using the [catlist] shortcode as shown:

[catlist id=1]
[catlist name="news"]

Shortcode works both with category name or id, it accepts the order in which you want the posts to display, and the number of posts to display.

The shortcode also allows you to show the post author, date, excerpt, custom field values, even content!

[catlist] shortcode can be used multiple times with different arguments on each post/page. There are various more parameters so you can display posts in your style. Following example will show-up 10 articles from category id 1:

[catlist id=1 numberposts=10]

Read the instructions for learning more about its different parameters. The plugin also includes a widget which you can add from Dashboard –
> Appearence -> Widgets page.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.