List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or
|Author:||Fernando Briano (profile at wordpress.org)|
|WordPress version required:||3.3|
|WordPress version tested:||4.9.1|
|Added to WordPress repository:||16-08-2008|
|Total downloads:||1 865 524|
|Active installs:||100 000+|
Click to start download
You can find the Frequently Asked Questions here.
- Upload the
list-category-postsdirectory 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.
INSTRUCTIONS ON HOW TO USE THE PLUGIN
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:
Then just add a new text widget to your blog and use the shortcode there as the widget’s content.
HTML & CSS Customization
How to customize the way the posts are shown: Template System. I am aware the Template System is not the friendliest right now, I’ll work on improving this if I ever get the time to work on it.
NEW FEATURE REQUESTS, BUG FIXES, ENHANCEMENTS
You can post them on GitHub Issues.
- Improvements to
customfield_orderby. Please check the readme for more information.
- Several bug fixes to pagination.
- Do not hide empty categories from widget.
Special thanks to Klemens Starybrat (zymeth25) for all the contributions.
- Add pagination function for templates.
- Possibly fixed a bug where the code for the Paginator class would show up in some blogs. Apparently some PHP ini accept “<?” as a valid way of starting a php file, others don’t.
- Adds “next” and “previous” classes to the previous and next buttons in pagination menu. The classes are
lcp_nextlink. Thanks @zymeth25.
- Adds pagination to Widget.
- Bug fix release:
[catlist categorypage="yes"]had stopped working with WordPress 4.9. This is because the category check would compare a return value against the “Empty Term” translation key which was changed in this commit adding periods at the end of some error messages. So it was just a matter of adding the period in the if condition. Thanks helmutka for reporting this!
- Bumped version because WordPress.org wouldn’t grab the previous one.
- Support “and” relationship for custom taxonomies, by Dalton Rooney.
- Support for multiple taxonomies in the same shortcode by TheSquiffy
- Tested up to WordPress 4.9
- Adds Irish translation by Jordan Silaen.
Several bug fixes:
- Makes sure the
tags_as_classinstance variable is defined. This squelched an ‘undefined index’ PHP Notice that appeared for widgets that were last saved before upgrading to 0.71.1. Fix by Matthew Eppelsheimer (@MatthewEppelsheimer on GitHub).
- Adds a new tutorial in the docs, check it out!
- Fixes a bug where customfield_value wouldn’t work if a custom field’s value = 0
- Adds tag/class html customization refactor to excerpt to behave as expected:
- If you provide
excerpt_class, excerpt will be wrapped with given tag.
- If you provide
excerpt_class, excerpt will be wrapped with provided tag and given class.
- If you provide
excerpt_tag, excerpt will be wrapped with a span and the given class.
- If you provide
- Fixes an error notice when widget is displayed for “current category” on post without category –
Notice: Undefined offset: 0 in /include/lcp-category.php on line 69
- Fixes “Undefined index: tags_as_class”. Thanks @vacuus for the Pull Request! 🙂
- Added tags_as_class: Use a post’s tags as a class for the li that lists the posts. Default is no. Thanks @vacuus on GitHub for this PR!
- Fixed customfield_class and customfield_tag issues. Thanks vacuus!!
- Tested up to WordPress 4.6.1
- Added date range, thanks again vacuus!! Check the docs to read how to use this.
- Update lcp-widget.php for PHP 7 compatibility. Thanks @kenshin23!
Thanks @mmatthews1981, @ottadvantage and @mhoeher for their contributions on this version:
- Adds Alt Tag to thumbnail
- Handle child_categories flag correctly – https://github.com/picandocodigo/List-Category-Posts/pull/185
- Adds a default value to numberposts on plugin activation – https://github.com/picandocodigo/List-Category-Posts/pull/193
- Bugfix release, this should fix the issues with Parent Categories listings.
- Adds custom css class to current page in pagination
- Adds child_categories parameter to being able to exclude child categories’ posts from a list.
- New feature to look for the first image in a post when requesting a thumbnail and the post has no featured image. Thanks Michael J. Gibbs for writing this code 🙂
- Full release notes: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
- Orders the README a bit.
- Issues with tags when using more than one tag for OR and AND relationships should be fixed.
- Documented the use of custom taxonomies. For some reason I never came around to do that. I changed the parameters for taxonomies, it used the ‘tags’ parameter for ‘terms’ before, so I added a ‘terms’ parameter to make this independent from the tags parameter. So now it looks like this:
[catlist taxonomy='person' terms='bob']. This might break some current uses of taxonomy, but since it was written so long ago and I don’t know why it used “tags”, I decided to just create the ‘terms’ parameter. People using the custom taxonomies were people who are looking at the code anyway since I can’t find it documented anywhere. Sorry for the inconveniences!
- Adds category description parameter.
- Adds orderby and order to options page. Removes default values since they’re the default anyway.
- Adds pagination parameter to the options page.
- Changes the loop in the default template.
- Fixes ‘morelink_class not working with templates’ in the default template.
- Adds link to post wrapper for the post date. If you have a chance, please thank bibz who is doing awesome Pull Requests to this plugin and occasionally helping out on the support forums here too 🙂
- Fixes get_current_tags
- Some updates on the documentation
- Introduces a conditional title, only displayed when posts are found, thanks bibz for this Pull Request!
customfield_display_name_glueparameters for multiple custom fields handling by bibz. Thanks! 😀
- Remove renamed file (Damn using subversion), should fix issues updating.
- Vagrant box and development environment improved by bibz
- Tested with WordPress 4.3, updated Widget constructor because of PHP 4 deprecation.
- Dutch translation by Gerhard Hoogterp, thank you!
- Re-add the loop fixes and fixes function missing from last time by Sophist-UK, thanks!
- Allow to order by the modified date in the widget by bibz, thanks!
- Adds Portuguese from Portugal (pt_PT) translation, muito obrigado Joaquim Félix!
- Fixes translation paths, thanks monpelaud!.
- Reverts switching to the loop til we find a way around for using templates.
- Fixes the loop so that other plugins work as if this was a blog or archive post.
See issue #156
on Github. Thanks Sophist-UK for this new version 🙂
- Tested with WordPress 4.2
- Sophist’s fix: Check for multi-byte functions installed and use ascii functions if not.
- Fix some errors
Thanks Sophist from UK for this release 🙂
- Fix error causing call to undefined method
- Add excerpt=full to allow either full explicit excerpt or use <?–more–> to define where the excerpt ends.
- Fixes link_titles=false creates plain text rather than unlinked formatted text as you might expect.
- Fixes title_limit not working correctly
Other minor fixes by me.
- Fixes an error with pagination links. Accessing $_SERVER filtered not working on some servers, have to investigate further for a future version.
- Addresses warning messages when debug enabled.
- Removes filter interfering with filters set by other plugins. Thanks zulkamal for the Pull Request!
- Adds option to display titles without links. Thanks zulkamal for this Pull Request too! 😀
- Workaround to prevent ‘?&’ to appear in URLs. Thanks mhoeher for the Pull Request!
- General refactors for improving code quality/security.
- Fixed typo in Readme (Thanks Irma!).
- Fixes excluding tags when using category name (should fix other issues with category name too since there was a bug there).
- Add custom image sizes to the list of selectable image sizes in the widget. Thanks nuss for the Pull Request!
- New Attribute ‘no_post_titles’. Thanks thomasWeise for the Pull Request!
- Finnish localization. Thanks Newman101 for the Pull Request!
- Adds Indonesian (Bahasa Indonesia) translation. Thanks Dhyayi Warapsari!
- Adds french from France language. Thanks Dorian Herlory!
- Adds content=full parameter to ignore tags when displaying content. Thanks Sophist-UK!
- Fixes excluded_tags parameter
- Ordered lists now follow the posts count when using pagination – https://wordpress.org/support/topic/templateol-resets-count-when-using-pagination
- Fixes issue introduced in 0.54 with undefined indexes – https://wordpress.org/support/topic/problem-continues-with-0542
- Fixes call to undefined method lcp_get_current_post_id()
- Fixes bug in LcpParameters.
- Adds http/https check for pagination links.
post_typeparameters for using multiple post statuses and types.
- Big refactor: Thumbnail code, parameters moved to new class,
created util class, removed bad and repeated code, moved category
code to new class. Small fixes all around the place. Went from a
very bad 1.77 GPA to 3.23 on CodeClimate.
- Makes “starting_with” parameter accept several letters, by Diego Sorribas. Thank you!
- Small fix for pagination and query string.
- Fix on multiple categories with AND relationship.
- Fixes options page 404 and saving options.
- Tested with WordPress 4.1.
- Fixes translations, updates Spanish translation. Translators, please update your po and mo files and submit them via pull request on GitHub 🙂
- Test compatibility with WordPress 4.0
- Adds icon for WordPress 4.0 new plugin interface.
- Fixes posts_morelink and customfields for templates.
- Adds fixes by htrex:
- Fix custom template regression
- Fix excluded categories not working in widget
- Addresses some warnings / scandir on Displayer and catname on widget
- Fixes lcp_paginator.css path
- Some small sanitations
- Small fix on templates
- Fixes issue with catlink.
- Fixes issue with templates named “default”
- Adds Thai translation by itpcc.
- The widget can now select an existing template. Thanks Borjan Tchakaloff!
- Templates code was refactored.
- Makes sure “starting_with” queries are case insesitive.
- Fixes category link on ‘catlink’ and ‘catname’ parameters (were showing twice)
author_posts_link, to show an author’s page.
- Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the forum.
- Small bug fix for getting current category. Used to check against simple string, now checking against i18n’ed one.
- Bug fixes
- Adds parameter to show modified date of posts. Thanks Eric Sandine for the Pull Request 🙂
- Adds Ukranian translation by Michael Yunat http://getvoip.com
display_idparameter. Set it to yes to show the Post’s ID next to the post title.
starting_withparameter. Gets posts whose title start with a given letter.
- Finally (hopefully) fix the excerpt issues.
- Fix something that I broke on previous update for excerpt :S
- Some fixes on displaying excerpt.
- Fixes quotes bug on title tag.
- Only show ellipsis when title.size > title_limit when using the
- Adds “the_excerpt” filter to excerpt to improve compatibility with
the Jetpack plugin.
- Add character limit to title
- Removes debug warnings
- Output valid HTML, attribute quotations – thanks Nikolaus Demmel!
- Adds ol default template to
- Improves documentation.
- Removes warning when using current tag in pages
- Small fix on Readme
- Adds the feature to get an author’s posts
- Adds show posts from current post’s tags.
- Show “no posts text” only if it’s been set and there are no posts,
otherwise behave like before.
- Removes filters to order by (should fix issues with order)
pagination_nextparams to customize
the “Previous” and “Next” buttons on pagination navigation.
- Only show pages in pagination when they are > 1
no_posts_textparam to display a custom message when no
posts are found
- Fixes “morelink” class parameter (now can be used without
specifying an HTML tag and the class is applied to the a tag).
- Adds missing title attribute from thumbnail links.
- Fixes pagination numbers
- Removes warning on wp-debug set to true
- Fixes some debug warnings (Ruby’s nil doesn’t apply in the PHP World)
- Fixes excludeposts=this.
- Adds customfield_tag and customfield_class to customize an HTML tag
and CSS class for custom fields.
- Small bugfix with customfield_display_name (wasn’t working now it
- Fixes customfield display name.
- Fixes size in getting thumbnails, now checks for all available
sizes and defaults (“thumbnail”, “full”, etc.)
- Adds options page, to set the default numberposts value globally.
- Adds pagination to custom template.
- Fixes date display.
- Adds conditions to Vagrantfile to boot faster and not repeat work.
- Fixes exclude posts, broken when migrating from get_posts to
- Small fix closing quotes on content when using
- Tested with WordPress 3.8
- Removes unnecessary stuff on wp_enqueue_styles
- Fixes validation when using quotes in title
- Fixes on tag
- Fixes on title HTML tag and CSS class. (See HTML & CSS
Customization on Other Notes to check the expected behaviour)
- Adds “post suffix” parameter, to add a String after each post
- Adds pagination. Check Pagination on Other
to learn how to use it.
- Adds “How to display thumbnails next to title” to the FAQ.
- Adds a Vagrant box for developers to be able to start coding with
no effort 🙂
moretag. If there’s a <!–more–> tag in the post, then it will behave just as WordPress does: only show the content previous to the more tag.
- Fixes YouTube thumbnails: Includes “embed” urls for youtube video
thumbnails, makes correct img tag when using CSS class.
- Fixed category_count for several categories.
- Fixed catlink to display titles for all the categories when using more than one category.
- Adds option for “target=_blank” for post links.
- Adds option to exclude category when using the and relationship:
[catlist id=1+2-3]will include posts from categories 1 and 2 but not 3.
- Updated Turkish translation, thanks again Hakan Er!
- Adds feature to order by custom field using the
- Bugfix (removed var_dump)
- Now accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will wrap the element between span tags and the given CSS class. Check Other notes under HTML & CSS Customization for more info.
- Fixed bug on
post_status, it used to show all published posts and if user was logged in, all private ones too. Now you can specify ‘private’ to just display private posts, and draft, publish, draft, etc (See post_status param on the instructions for more info).
- Fixes bug with thumbnail size on Widget.
- Adds feature to make widget title a link to the category. Use ‘catlink’ as the value for the widget’s title to make it a link to the category (based on https://github.com/picandocodigo/List-Category-Posts/pull/51/).
- Fixes morelink styiling with CSS class and tag.
- Adds morelink to templates (based on https://github.com/picandocodigo/List-Category-Posts/pull/48/)
- Fixes tag and CSS class for “catlink” too: https://wordpress.org/support/topic/cat_link-tag-does-not-seem-to-be-working
- Add category count parameter to show the number of posts in a category next to its title. Only works when using the catlink option:
[catlist name=nintendo catlink=yes category_count=yes]– https://wordpress.org/support/topic/count-feature
- Pull request from @cfoellmann, adds testing environment and Travis CI integration. Awesomeness.
- When searching for a thumbnail, if there’s no thumbnail on the post but there’s a YouTube video, display the YouTube video thumbnail. (wordpress.org/support/topic/youtube-thumbnail)
- Bugfix release, fixes current category for post/page
- Improves ‘current category’ detection.
- Adds categorypage parameter to widget
- excerpt – Fixed default excerpt behaviour from previous release. By default it will strip html tags as it always did. If you want it not to strip tags, you’ll have to use
excerpt_strip=no. Added a new parameter to have a consistent excerpt. If you want to overwrite WordPress’ excerpt when using the plugin and generate one the way the plugin does when there’s no excerpt, use
- Adds ability to exclude tags.
- Changes excerpt. Since lot of users have asked for it, I once again modified the way the excerpt is shown. It now respects your theme’s allowed HTML tags and doesn’t strip them from the excerpt. If you want to strip tags, use
- Adds turkish translation, thanks Hakan Er for writing this translation! 🙂
- Adds “AND” relationship to several categories. Thanks to hvianna from the WordPress forums who implemented this feature 😀
- More improvements on readme.
- Improvements on readme, faqs.
- New posts_morelink param: adds a ‘read more’ link to each post.
- Sets minimum version to WordPress 3.3, since wp_trim_words was introduced in that version. Adds workaround for people using WordPress < 3.3.
- Adds Slovak translation by Branco from WebHostingGeeks.com.
- Removes Debug PHP warnings.
- Checkboxes on Widget save state, i18n for widget.
- Adds excerpt size to widget.
- Fixes to widget.
- Adds year and month parameters to list posts from a certain year and/or month.
- Adds search parameter to display posts that match a search term.
- Adds i18n, German and Spanish translations. All credit to cfoellmann for implementing this and writing the German translation. Thanks! 🙂
- Changed excerpt limit, it uses word count, and is working for WordPress’ excerpt and auto generated ones.
- Better excerpt
- Applies title filter, should work with qTranslate
- Adds post status parameter
- Adds meta links to plugin page – most importantly: INSTRUCTIONS (please read them).
- Fixes “excerpt doesn’t strip shortcodes” – https://github.com/picandocodigo/List-Category-Posts/issues/5
- Exclude currently displayed post – 1, 2
- Add title to category title 1, will be improved.
- Attempting to condition whitespaces to WordPress Coding Standard (emacs php-mode sucks for this…)
- No more git-svn crap, now I’m developing this over at (GitHub)[https://github.com/picandocodigo/List-Category-Posts] and copying it into the WordPress SVN Repo.
- Bugfix release
- Bugfix release
- Added excerpt size. You can set how many characters you want the excerpt to display with ‘excerpt_size’.
- Fixed HTML tag and CSS class for each element (Check Other notes for usage).
- Removed shortcodes from excerpt.
- Fixed thumbnail size parameter, added usage example on README.
- Added space after author and date https://wordpress.org/support/topic/plugin-list-category-posts-space-required-after
- Fixed bug with the categorypage=yes param.
- Tested with WordPress 3.3.
- Fixed accidentally deleted line which made the catlink=yes param not work.
- Added CSS “current” class hook for current post in the list: .current class attached to either the li or a tag of the currently viewed page in the said list. http://wordpress.stackexchange.com/q/35552/298
- Added morelink parameter, check Other notes for usage.
- Removed var_dump… (Sorry about that)
- Small fixes:
- Used “empty()” function for some Strings instead of evaluating isset() and != ”.
- Include parameters on the get_posts args only when they are set (post_parent among others).
- Added ‘thumbnail_class’ parameter, so you can set a CSS class to the thumbnail and style it.
- Brought back the multiple categories functionality for the id parameter. Hopefully the last 0.20 bugfix release so I can start working on new stuff to implement.
- Now the name parameter accepts multiple categories too. Just use:
- Yet another bugfix, regarding nothing being displayed when using tags.
- Fixed category detection code, which created some messy bugs in some cases
- Minor bugfix release
- Fixed extra ” added to ul tag, thanks ideric (https://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
- Added the possibility to list posts from the current post’s category
- Some fixes to documentation
- Another taxonomy fix, thanks frisco! https://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
- Small fix, missing parameter for taxonomy.
- Added thumbnail to Widget.
- Added thumbnail link to post (http://picod.net/33).
This update is dedicated to S. Keller from Switzerland who gave me “The Ultimate Hitchhiker’s Guide to the Galaxy” from my Amazon Wishlit in appreciation for the plugin. I am really enjoying the read :D. If you, like S would like to show your appreciation, here’s my wishlist:
- Fixed private post logic, not displaying post if private. Thanks Bainternet from WordPress Answers: http://wordpress.stackexchange.com/questions/12514/list-category-posts-not-showing-posts-marked-private-to-logged-in-users/12520#12520
- Added thumbnail_size parameter.
- Added support for custom taxonomies and also moved to the array call of get_posts. Coded by wsherliker, thanks! http://picod.net/32
- Fixed widget, now it remembers saved options.
- Small excerpt fix, some readme file fixing too.
- Not showing the_content for password protected posts.
- Small fixes. Should work for name parameter in all cases now.
- Added slug and name to the fetching of category id from previous update.
- Fixed category id bug. Reported and fixed by Eric Celeste – http://eric.clst.org, thanks!
- Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
- Added category link which wasn’t working after previous big update.
- Fixed displaying of “Author:” even when not being called.
- Major rewrite. The whole code was rewritten using objects. It’s easier now to develop for List Category Posts.
- Both STYLESHEETPATH and TEMPLATEPATH are checked for templates.
- Fixed shortcode nesting.
- Changed STYLESHEETPATH to TEMPLATEPATH to point to the parent theme.
- Added support to display custom fields. (http://picod.net/wp03)
- Tested with WordPress 3.1 – https://wordpress.org/support/topic/399754
- Fixed a bug with undeclared variable. (Check http://picod.net/walcp, thanks Das!)
- Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
- Fixed “Show the title of the category with a link to the category” code (catlink param), it broke on some previous update, but now it’s working again. Thanks Soccerwidow on the WP Forums for pointing this out.
- Added “post_type” and “post_parent” from the underlining “get_posts()” API to be usable within the short-code. By Martin Crawford, thanks!
- Added the “class” parameter to style the default ul. You can pass a class name, or the plugin will use “lcp_catlist” bby default. Thanks Chocolaterebel (https://wordpress.org/support/topic/plugin-list-category-posts-sharing-my-own-template-in-lcp).
- Fixed “tags” parameter on the documentation, it used to say “tag”, and the plugin looks for “tags”.
- Fixed thumbnail code, added it to default.php template as example.
- Fixed broken dateformat.
- Show post thumbnails, should be tested, feedback on styling is welcome. Thanks to Sebastian from http://www.avantix.com.ar/
- Added comments count.
- Updated readme file
- Another minimal bug fixed with the excerpt…
- Fixed small bug which made the excerpt show up everytime… (Sorry :S)
- Automatic excerpt added in case the user didn’t specifically write an excerpt.
- Widget has been finally fixed. The attributes finally save themselves, and the widget works as expected 😀
- Small fix –
added ul tags to default template.
- Compatible WordPress 3.0 with Twenty Ten theme (thanks again Doug Joseph 🙂 )
- Code for the_content was fixed so that the content to output filtered content (thanks DougJoseph https://wordpress.org/support/topic/399754)
- admin parameter now shows “display name” instead of “user nice name”.
- Template system has changed: In older version, custom templates got deleted if an automatic upgrade was done. Now templates are stored in the theme folder. (Thanks Paul Clark)
- Added tag support
- Fixed bug for ‘content’.
- There’s new stuff on the widget options. I’m still working on it, so some bugs may appear.
- Widget implements WP 2.8 Widget API, so at least 2.8 is required. Now you can use as many widgets as necessary, with new params.
- Updated readme file.
- Fixed link to category.
- Improved template system.
- Fixed uber stupid bug with offset… Sorry about that!
- Exclude posts. Contribution by acub.
- Offset parameter on shortcode to start listing posts with an offset. Contribution by Levi Vasquez
- Content of the post can now be displayed. Contribution by Lang Zerner.
- Link to the category available. By request on the plugin’s forum.
- Fixed small bug when using category name.
- Minor fix for unclosed ul if not using templates.
- Added option to list posts from many categories at once.
- Added option to exclude categories.
- Readme.txt validation.
- Added ‘excerpt’ parameter. You can now show the excerpt for each post.
- Added ‘dateformat’ parameter. Format of the date output. Default is get_option(‘date_format’) – by Verex
- Added ‘template’ parameter. Now you can choose template for output of the plugin. File name of template from templates directory without extension. Example: For ‘template.php’ value is only ‘template’. Default is ‘default’ that means template in code of plugin not in template file -by Verex
- Fixed some code to enable PHP 4 compatibility. Shouldn’t hosting services update to PHP 5?
- Added ‘date’ parameter. Now you can show the post’s date when listed.
- Added ‘author’ parameter. You can also show the post’s author.
- Sidebar Widget now allows you to add a title in h2 tags.
- Changed some variable names, to keep better compatibility with other plugins/wordpress variables.
- Tested with WordPress 2.7.
- Broke backwards compatibility. Users of version 0.1 should update their pages and posts for the new shortcode formatting.
- Option to pass arguments to the plugin, in order to use name of category instead of ID, orderby, order and number of posts are passed through parameters.
- Added experimental sidebar widget (use at your own risk, not ready for prime-time yet since it hasn’t been tested 😛 )
- Fixed major bug, which gave 404 error when trying to use “Options” page.
- Option page to limit number of posts.
- Working using [category=ID] for posts and pages, with several categories support.