| 开发者 |
fernandobt
zymeth25 |
|---|---|
| 更新时间 | 2026年3月15日 05:07 |
| PHP版本: | 5.6 及以上 |
| WordPress版本: | 6.9.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[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:
list-category-posts directory to your wp-content/plugins/ directory.Undefined array key QUERY_STRING. Report: https://wordpress.org/support/topic/php-8-4-issue-2/post_status introduced in sanitize_status. Thanks Galen Charlton (@gmcharlt) for the catch and fix!starting_with parameter - CVE-2025-10163. This solves SQL injection and results in starting_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.template parameter can only have letters, numbers, _ and - in the name. They also can only be located in the current theme's directory under a list-category-posts directory.list-category-posts under wp-content/themes/your-theme-folder.
https://www.cve.org/CVERecord?id=CVE-2025-47636excerpt_tag='script'.