Discover, trust, install: FAIR 1.0 is here
List category posts
Version: 0.92.0
Description
List Category Posts allows you to list posts by category in a post or page using the [catlist]
shortcode. When you’re editing a page or post, directly insert the shortcode in your text and the posts will be listed there. The basic usage would be something like this:
[catlist id=1]
[catlist name="news"]
The shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can also display the post author, date, excerpt, custom field values, even the content! A lot of parameters have been added to customize what to display and how to show it. Check the full documentation to learn about the different ways to use it.
The [catlist]
shortcode can be used as many times as needed with different arguments on each post/page.
[catlist id=1 numberposts=10]
There’s an options page with a few options, new options will be implemented on demand (as long as they make sense).
Read the instructions to learn which parameters are available and how to use them.
If you want to List Categories instead of posts you can use my other plugin List categories.
You can find Frequently Asked Questions here.
Customization
The different elements to display can be styled with CSS. you can define an HTML tag to wrap the element with, and a CSS class for this tag. Check the documentation for usage. You can also check this nice tutorial which gives lots of tips and how-to’s to customize how to display the posts.
Great to use WordPress as a CMS, and create pages with several categories posts.
GUI
Klemens Starybrat has created a GUI for List Category Posts. It helps you create a shortcode from a nice visual interface in WordPress’ text editor. Check it out:
GUI for List Category Posts
AJAX pagination
The ajax pagination feature is maintained in an add-on plugin by Klemens Starybrat. Check it out:
LCP Ajax Pagination
Widget
Since WordPress 4.9, you can use shortcode in text widgets. So you can just add a text widget in Appearence > Widgets and write the List Category Posts shortcode.
The plugin also includes a widget as a simple interface for its functionality. Just add as many widgets as you want, and select all the available options from the Appearence > Widgets page. Not all the functionality in the shortcode has been implemented in the widget yet. You can use the shortcode for the most flexibility.
Please, read the information on the wiki and Changelog to be aware of new functionality, and improvements to the plugin.
Videos
Some users have made videos on how to use the plugin (thank you, you are awesome!), check them out here:
- Manage WordPress Content with List Category Posts Plugin
- WordPress: How to List Category Posts on a Page
Support the plugin
Klemens Starybrat has been writing lots of amazing code for this plugin, so if you’ve found it useful and want to pay it forward, consider sponsoring him on GitHub: https://github.com/sponsors/klemens-st
I have a PayPal account where you can donate too.
Development
Development is being tracked on GitHub. Fork it, code, make a pull request, suggest improvements, etc. over there. I dream of the day all of the WordPress plugins will be hosted on Git 🙂
Since the documentation on how to use the plugin has passed wordpress.org’s character limit, the text was cut. I’ve since started using a wiki for more comfortable reading and maintaining. Please check it out, suggestions are welcome on GitHub issues!
Instructions on how to use the plugin
Below you can find common shortcode use cases. You can use the shortcode while editing posts, pages, custom post types, text widgets and in all “page builder” plugins that support shortcodes.
Read the full documentation to discover many more features, including:
- advanced post selection options (by date, search terms, custom fields, post types, custom taxonomies and more)
- output customizations (show each post’s date, author, excerpt, thumbnail and more)
- custom templates of your own design, based on a simple PHP example
List 10 latest posts:
[catlist]
The default number of listed posts is 10, to modify it you need to specify numberposts
parameter:
[catlist numberposts=15]
List posts from the “Dogs” category:
[catlist name=Dogs]
List posts from the category with id 2
:
[catlist id=2]
By default only the “post” post type is included. To list pages use:
[catlist post_type=page]
and for both posts and pages:
[catlist post_type="post,page"]
If we combine the above options we can get a shortcode that lists 15 items, including post and pages, from the “Dogs” category:
[catlist name=Dogs post_type="post,page" numberposts=15]
Most of the parameters you will find in the documentation can be used together.
The plugin can detect current post’s category and use it for listing:
[catlist categorypage=yes]
Same goes for tags:
[catlist currenttags=yes]
To show each post’s excerpt use:
[catlist excerpt=yes]
If you want to show the date, author and comments count next to each post, use:
[catlist date=yes author=yes comments=yes]
You can specify html tags and classes for many elements. Let’s modify the previous shortcode and wrap dates and authors in tags and classes of our choice:
[catlist date=yes date_tag=span date_class="my-date" author=yes author_tag=p author_class="my-author" comments=yes]
You can order posts by date:
[catlist orderby=date]
You can also use title
, author
, ID
. More options are described in the documentation.
The plugin also supports pagination. You need to specify numberposts
to tell the plugin how many posts per page you want:
[catlist pagination=yes numberposts=5]
See the wiki: Pagination for more information.
Please read the full documentation for detailed documentation of all plugin features, use cases and shortcode parameters.
Installation
- Upload the
list-category-posts
directory to your wp-content/plugins/ directory. - Login to your WordPress Admin menu, go to Plugins, and activate it.
- Start using the ‘[catlist]` shortcode in your posts and/or pages.
- You can find the List Category Posts widget in the Appearence > Widgets section on your WordPress Dashboard.
- If you want to customize the way the plugin displays the information, check HTML & CSS Customization or the section on Templates on the wiki.
Faq
You can find the Frequently Asked Questions here.
Check out the Wiki
Please read the instructions and the FAQ before opening a new topic in the support forums.
The widget is quite simple, and it doesn’t implement all of the plugin’s functionality.
Since WordPress 4.9, you can use a shortcode in a widget. If you’re using a previous WordPress version, add this code to your theme’s functions.php file:
add_filter('widget_text', 'do_shortcode');
Then just add a new text widget to your blog and use the shortcode there as the widget’s content.
How to customize the way the posts are shown: Template System.
You can post them on GitHub Issues.
Please check the FAQ before posting a question. You can post questions in the Support forum or add a new issue on GitHub.
Reviews
wonderful plugin
By gdavide on September 2, 2024
I used to do this kind of things with manual and hacky changes to wordpress themes, this created a lot of problem to upgrade themes. With this plugin you can change the post lists in a lot of ways. It saves my day!
Works great with the free Beaver Builder!
By Brisch (brisch) on February 18, 2024
Works great if you want to show a post preview on a page with the free Version Beaver Builder!
Enhancing Content Organization and Presentation: A Review of List Category Posts
By Alex De Py (alexnleo) on January 12, 2024
As a long-time WordPress user, I've encountered numerous plugins, each promising to enhance the functionality of my website. However, few have impressed me as much as the List Category Posts plugin. This versatile tool has become an indispensable part of my WordPress toolkit, streamlining how I organize and display content across my site.
The plugin's core strength lies in its simplicity and effectiveness. With straightforward shortcode implementation, I can easily display a list of posts from specific categories on any page or post. This functionality not only improves the navigability of my site but also enhances the overall user experience. The ability to fine-tune the display – including adjusting post counts, ordering, and even including elements like excerpts and author names – provides a level of customization that is both powerful and user-friendly.
One feature I particularly appreciate is the plugin's ability to detect the current post’s category and use it for listing, making dynamic content display a breeze. The flexibility to mix post types in a single list further adds to its utility, especially for sites with diverse content.
The plugin's developer has done an exceptional job in balancing functionality with usability. The extensive documentation and active support ensure that even less tech-savvy users can make the most of its features. Its compatibility with various themes and plugins makes it a reliable choice for a wide range of WordPress users.
In summary, the List Category Posts plugin stands out for its effectiveness in enhancing content organization and presentation on WordPress sites. It's a testament to thoughtful development focused on real-world utility and user experience.
Allows me to use WP like the database it is
By WebSprite (contentsprite) on September 6, 2023
I've been using this plug in for years - and I've been remiss not leaving a review. I run a single site with a core set of portfolio type items that have a general information page.
Because of this plugin, I can type the description in a portfolio type post and have just the pieces I want replicated on the product page or in a blog post about the item. That's what databases are supposed to do - avoid replication of the same data. I decide to update a description, I fix it in one place and anywhere I've used that description gets updated.
It took trial and error and poring over the documentation, which is really good, to make it all work, but it was completely worth it. Thank you!
great plugin
By d2pren on August 17, 2023
Very usefull for me
Great Plugin
By trevalyan on March 16, 2023
it changed the way i work, much easier now. thx
great plugin
By modelscoordinationil on February 24, 2023
the plugin gives you the flexibility to control the display of posts in many ways and by many filters.
The many options available allow for insertion of posts lists by category in different ways, even in the same page. The pagination option works very well. posts can be displayed in full or title or excerpt.
It may require definition of css to get what you want. But there was plenty documentation in the plugin page to learn how to do it. (more examples of css setting would be nice)
thanks
excellent
By twohills on October 23, 2022
Does what the plugin says it does
By Cloud Development (clouddevelopment) on May 8, 2022
Shows all posts on same page
By aaronlkh on April 29, 2022
Changelog
See CHANGELOG.md for full Changelog.
0.92.0
- Avoids potential SQL injection in
starting_with
parameter – CVE-2025-10163. This solves SQL injection and results instarting_with
working as per the Wiki, but the previous code also allowed things like[catlist starting_with="Hello"]
which would return posts starting with “Hello” but not just with “H”. This new implementation would return both, because only the first character matters, which is ok because that’s what is documented. - Improves template file inclusion security. Template files when using the
template
parameter can only have letters, numbers,_
and-
in the name. They also can only be located in the current theme’s directory under alist-category-posts
directory.
0.91.0
- Addresses CVE-2025-47636, avoids Local File Inclusion for template system. The code will remove any occurrences of the string ‘../’ in the template parameter. Templates files must be php files located in a directory named
list-category-posts
underwp-content/themes/your-theme-folder
.
https://www.cve.org/CVERecord?id=CVE-2025-47636
0.90.3
- Hardens xss fix for script tag by checking case insensitive and using tag_escape.
0.90.2
- Updates fix for stored cross-site scripting from 0.90.0, now applied to all tags. From this version onwards, script is not available to use as a tag when setting an element’s tag in the shortcode.
0.90.1
- Fix PHP 8.2 deprecation notices
- Remove empty anchor tags from widget morelink
0.90.0
- Fixes a Stored Cross-Site Scripting issue using
excerpt_tag='script'
.