WP Category Post List is a plugin using which you can display category filtered posts via Widgets or Shortcodes. The widget holds more than 30 options to customize and shortcode has 15 attributes to configure. The current version is 2.0.3 which is fully compatible with WordPress version 3+. Below are the documentation and development news.
Version: Downloads: Rating: /5 Updated: Requires: WordPress
Documentation:
[tabs slidertype=”left tabs”] [tabcontainer] [tabtext]Installation[/tabtext] [tabtext]Widget[/tabtext] [tabtext]Shortcode[/tabtext] [tabtext]Plugin Option[/tabtext] [tabtext]CSS & Filter[/tabtext] [tabtext]FAQs & Tips[/tabtext] [tabtext]Change Log[/tabtext] [tabtext]Known Issues[/tabtext] [/tabcontainer] [tabcontent] [tab]
#1: Installing the Plugin:
Just download the plugin from here. (WordPress plugin directory) and upload it to your plugin directory and activate it. Alternately you can:
- Go to Admin » Plugin » Add New and search for WP Category Post List.
- Install the plugin from there and activate it.
#2: Initial Setup:
- Go to Admin » Settings » Category Posts (WP-CPL) and set your Thumbnail size and theme.
- If you have set a new thumbnail size, then I would recommend you to install the Regenerate Thumbnail plugin and regenerate the thumbnails.
- Now go to the widget are from Admin » Appearance » Widgets.
- You will notice a new widget WP Category Post List. Drag it to one of your widget area and set it up.
That’s it. You are done. For the Advanced Options, just hit the Toggle button.
[/tab] [tab]
#1: Complete Widget Options list:
You can easily find it from the Admin » Settings » Category Posts (WP-CPL)You will see a table there with a complete list of information for every option. In case you are curious, here is a list of it here.
Option | Description | Parameter | Default | Example |
---|---|---|---|---|
Description | Parameter | Default | Example | |
Basic Options | ||||
Title | The Title of the widget. This will be displayed over the top of each widget | It has the following options paramter. You can insert them on the title and it will get replaced by the corresponding values |
- %widget_num% :
The number of posts you want to display - %cat_count% :
The total number of posts the category has - %cat_name% :
The category name
Browse %cat_name%Be creative and form your own
TeaserA one liner shown below the widget, just above the Read More button(if present)Offers Same options as TitleFeaturing Top %widget_num%/%cat_count% of %cat_name%CategoryThe category you want to chose. Select one from the listN/AN/AN/ACSS ThemeNEW in V2… Choose the CSS theme for this widget. Global themes are not applied to any widget anymoreN/AN/AN/AShow LinkIf ticked this will show a Read More link at the end of the widget. This will link to the categoryN/ABy default this is tickedN/ANumber of PostsThe total number of posts that would be shown on the widget. This excludes the number of sticky posts.N/A10What ever you can imagineComment countWhether you want to show comment count beside every posts.N/AUnticked. Not shown by defaultN/AShow dateNEW in V2 If ticked publish date will be placed below the post titleN/AUnticked.N/AShow authorNEW in V2 If ticked author name hyperlinked to author archive will be placed below the post title.N/AUnticked.N/AShow excerptNEW in V2 If ticked post excerpt will be placed below the post title.N/AUnticked.N/AExcerptNEW in V2 The length of characters of the excerptN/A50Numerical valuePost ExcerptNEW in V2Gives preference to manually entered WP excerpts on posts. This will override the excerpt length.N/AUntickedN/AShow FeedIf ticked a link will be placed before the title to the feed of the category.N/ATicked. Attempts to show the feedN/AShow ReadmoreIf ticked this will show a Read More link at the end of the widget. This will link to the categoryN/ABy default this is tickedN/AFeed HTML/TextNEW in V2 This HTML or text will be wrapped inside an anchor text hyperlinked to the category feed.N/AN/AIf you would like to use image then do it like
<img src="https://path.to/img.jpg"" /> or simply a Text
[Syndicate]
Readmore HTML/TextNEW in V2 This HTML or text will be wrapped inside an anchor text hyperlinked to the category link.N/AN/AIf you would like to use image then do it like
<img src="https://path.to/img.jpg"" /> or simply a Text
[Syndicate]
Show Thumbnail & Thumb ClassWhether you want to show thumbnail beside every post, and if showing then the css class applied to the thumbnailThe Structure of the thumbnail is as follows
<span class="wp-thumb-overlay"> <span class="thumb_lay or userclass"> <img class="attachment-wp-cpl-post-thumb wp-post-image" title="Title" src="path/to/img.jpg" alt="alt" width="40" height="40" /> </span> </span>
thumb_layN/ASortingHere you have two options. Sort Order and Sort Using. You can choose from a number of available options for the Sort Using, and make it ascending or descendingSort Using has ID, title, date, comment or random options.Date -> AscendngN/AAdvanced OptionsList StyleHow the HTML list is formed. This is basically the HTML nestingUnordered list is the basic ul li type listing. You can select Custom Style to insert your own HTML tags before/after the list/linksHTML Unordered ListN/AWidget StyleThe CSS class applied to the widgetN/ABefore/After List/LinkThe HTML tag before the whole Widget ListBefore List supports only one parameter.%widget_class% :
Gets replaced by system generated widget class and your own widget classSimilarly Before Link supports one paramter%list_class% :
Gets replaced by system generated list class. This is needed if you are applying alternate list css classes
- Before List :
<ul class="%widget_class%">
- After List :
</ul>
- Before Link :
<li class="%list_class%">
- After Link :
</li>
- Before List :
<div class="my_class %widget_class%">
- After List :
</div>
- Before Link :
<p class="my_post class %list_class%">
- After Link :
</p>
Exclude PostsComma Seperated values of IDs of posts to excludeThe following ID format will work
12, 34,65 75,12 ,45
N/ASticky PostsSame as Exclude Posts. Only the posts will become sticky. This will not verify whether they belong to the selected category or not. They will be placed before the normal list and CSS class wp-cpl-sticky will be applied to themOpen inWhether to open in the current tab or new tabBasically _blank
or _self
will be added to the anchor tagCurrent TabN/AAlternate List CSSApplies Alternate Listing CSS classes to the list HTML tag.wp-cpl-odd or wp-cpl-even CSS classes will be added accordinglyN/A
Quite a long list eh?
[/tab] [tab]
#1: The Shortcode and Basic usage:
The basic shortcode and minimal usage is: (Without the space after [)
[ wp_cpl_sc cat_id=40 list_num=4 css_theme=2 sticky_post="79"]
You just have to change the cat_id, list_num and css_theme parameters and a list of posts will be shown accordingly.
However, there are other parameters using which you can further customize the shortcode. Here is the complete list:
#2: Shortcode parameters:
Parameter | Description | Default value | Accepted values |
---|---|---|---|
cat_id | The id of category from which the posts are to be displayed | 1 | Any numerical category id. You can check the Posts > Category and hover over the category Edit link to check the category |
css_theme | The id of the predefined or added CSS theme | 0 | Any numerical or string id value of the Themes. Here is the list of predefined CSS Themes:
|
is_thumb | Whether or not to display thumbnails | “true” | String “true” or “false” |
read_more | The teaser text for continue reading | “Continue Reading” | String like “Read more”. If empty string provided then it will not display any read more button |
list_num | Number of posts to display (max). This excludes sticky posts (if any) | 10 | Any numerical value |
show_comments | Whether or not to display comment counts in post meta box | “true” | String “true” or “false” |
sort_using | Select the sorting method. A corresponding ID should be passed. Check the accepted values. | 1 | Following are the accepted IDs. Note that you need to pass it like sort_using=2
|
sort_order | Select the sorting order ascending or descending | “asc” | The accepted values are:
|
exclude_post | Comma Seperated values of IDs of posts to exclude | ” | The following ID format will work ‘ 12, 34,65 75,12 ,45 ‘ |
sticky_post | Same as Exclude Posts. Only the posts will become sticky. This will not verify whether they belong to the selected category or not. They will be placed before the normal list and CSS class wp-cpl-sc-sticky will be applied to them | ||
show_date | Whether or not show date in post meta | “true” | “true” to display and “false” to hide |
show_author | Whether or not show author link in post meta | “true” | “true” to display and “false” to hide |
show_excerpt | Whether or not show excerpt in post meta | “true” | “true” to display and “false” to hide |
excerpt_length | The length of the excerpt (character count) | 150 | Any numerical value |
optional_excerpt | Gives preference to manually entered WP excerpts on posts. This will override the excerpt length | “false” | “true” to activate “false” to deactivate. |
[/tab] [tab]
This plugin comes with a settings page where you can set the thumbnail and enable/disable pre-installed CSS themes. Below is a preview of the page (Settings > Category Posts (WP-CPL))
- Use default CSS: Uncheck to completely disable loading the default CSS for the widget and shortcode.
- Thumbnail dimension: Set the widget and shortcode thumnail dimension. After you update, make sure to run Regenerate Thumbnail plugin to update the thumbs.
- CSS Theme: Select the theme which are to be loaded in the frontend and to be displayed under the Widget option. Make sure, you select one of the active themes while doing it with shortcode.
[/tab] [tab]
New in V2 is the filter API using which you can add your own CSS Themes. You need to add a filter to wp_cpl_css_filter and pass in the id, name and css_url of your theme. Rest will be taken care of, i.e, the plugin will automatically display the CSS Theme under the widget and settings page and also will enqueue it to the frontend. Here is how you do it.
#1: Writing your own plugin with the filter:
<?php /* Plugin Name: Filter API TEST Plugin URI: https://www.intechgrity.com/wp-plugins/wp-category-post-list-wordpress-plugin/ Description: Use the WP CPL Filter API to add our custom CSS Version: 1.0.0 Author: Swashata Author URI: http://www.swashata.com/ License: GPL2 */ function my_awesome_wpcpl_css($css_list) { $css_list['my_awesome_css'] = array( 'name' =--> 'My Awesome CSS', 'css_url' => plugins_url('/css/awesome.css', __FILE__) ); $css_list['my_aawesome_css2'] = array( 'name' => 'My Awesome CSS2', 'css_url' => plugins_url('/css/awesome2.css', __FILE__) ); return $css_list; } add_filter('wp_cpl_css_filter', 'my_awesome_wpcpl_css', 1);
and that will be all. Make sure you activate (check) the newly added theme from the WP CPL settings page before you start using it. Also you can add the same code inside your theme’s function.php file.
#2: The CSS template:
As of V2, there is a change in the CSS template. The shortcode and widget CSS are merged in the same file. Below is the template
/************************* * THE WIDGET SECTION ************************/ /** The li background */ .wp-cpl-theme-theme_id li { } /** The thumbnail */ .wp-cpl-theme-theme_id li span.wp-thumb-overlay { } .wp-cpl-theme-theme_id li.wp-cpl-sticky span.wp-thumb-overlay { } /** The even and odd */ .wp-cpl-theme-theme_id li.wp-cpl-even { } .wp-cpl-theme-theme_id li.wp-cpl-odd { } /** The sticky post */ .wp-cpl-theme-theme_id li.wp-cpl-sticky { } .wp-cpl-theme-theme_id li.wp-cpl-sticky a { } /************************* * THE SHORTCODE SECTION ************************/ /** Main wrap */ .wp-cpl-sc-theme-theme_id { } .wp-cpl-sc-theme-theme_id a { } .wp-cpl-sc-theme-theme_id .wp-cpl-sc-sticky a { } /** Entry wrap */ .wp-cpl-sc-theme-theme_id .wp-cpl-sc-post { } .wp-cpl-sc-theme-theme_id .wp-cpl-sc-sticky { } /** Thumb anchor */ .wp-cpl-sc-theme-theme_id .wp-cpl-sc-post .wp-cpl-sc-thumba { } .wp-cpl-sc-theme-theme_id .wp-cpl-sc-sticky .wp-cpl-sc-thumba { } /** Post h2 */ .wp-cpl-sc-theme-theme_id .wp-cpl-sc-post h2 a { } .wp-cpl-sc-theme-theme_id .wp-cpl-sc-sticky h2 a { } /** Post meta box */ .wp-cpl-sc-theme-theme_id .wp-cpl-sc-post .wp-cpl-sc-meta { } .wp-cpl-sc-theme-theme_id .wp-cpl-sc-sticky .wp-cpl-sc-meta { }
If you have any problem, ask in the post or in WP community.
[/tab] [tab]
#0: Is it possible to use different CSS for different widget?
- Technically & simply Yes. Now you can simply choose the css theme from the dropdown (widgets) or mention the id in shortcode.
#1: To style widgets differently:
- Now this can be done using our CSS Theme filter API. Check the corresponding section.
#2: Changing the post thumbnail size:
- Install and run Regenerate Thumbnails plugin by viper007.
- Use it just after setting your thumbnail size and after changing the size to a new value.
#3: My Thumbnails are not showing up exactly as the size I have selected
- WP CPL uses the default Thumbnail or Featured Image Feature of WP 2.9+. So, the thumbs are created when you upload the picture.
- For older pictures, it is not generated automatically. In such case just install and run this Regenerate Thumbnail Plugin.
- After installing it first time or whenever you change the Thumb size, it is recommended that you run this plugin once
[/tab] [tab]
The detailed change log can be found below:
Version 2.0.3
- Bug fix: On wp_cpl_output_gen.php file
- Added: Current Post category is now current post/archive page category. So a category archive page will populate the widget.
- Added: read_more attribute for shortcode using which you can change the continue reading text.
Version 2.0.2
- Bugfix to the occasion when no theme is selected
- Added a Master reset button to reset all the options
Version 2.0.1
- Immediate bugfix to WP auto upgrade conflict
Version 2.0.0
- Ability to select the category of the current post (Auto category detection)
- Shortcode support
- Post excerpt and other options like html enabled Readmore and subscription.
- Different height and width for widget and shortcode thumbnail
- Display author, date and other post meta.
- Added filter API to use your own CSS Theme with the plugin (both for widget and shortcode)
Version 1.1.0
- Not released in the WILD
- Ability to select the category of the current post
- Shortcode support (proposed)
- Minor bug fixes
- Options to show post date, author and excerpt
- New interface for read more and feed link
Version 1.0.0
- Public Release
- Several bugs fixed
- Fixed the Read More permalink bug
- Added 2 more themes
- Added Teaser Option
Version 0.9.0 RC
- Themeing Support
- Complete Widget Interface
- Stand alone support for WordPress post thumbnail activation. Even if your theme does not support.
- All Documentation can be found in the Plugins Settings page
Version 0.0.9 alpha
- Added basic widget querying posts
- Added thumbnail support etc.
- Still under development. Please dont install
Version 0.0.8 alpha
- Initial Upload to WP SVN
- Under development. Please dont’t install
[/tab] [tab]
The only issue I know is it does not show post counts to the parent category from the child category. I am working on a solution for this. If you know a method please let me know.
The above issue has been solved. The solution is given here. Right now no issues have been encountered. However if you find one, please give a feedback here.
[/tab] [/tabcontent] [/tabs]
Pingback: WP Category Post List Plugin - List your posts filtered by categories with thumbnails | InTechgrity
Pingback: WP Category Post List version 2 released - InTechgrity | InTechgrity
Hi…. I think this new version is so difficult to be customized. I’m not a CSS master. I’m just a newbie. I learn it myself. And I find it too difficult to me to customize this plugin.
Have any idea? I like this plugin so much. But now I a little disappoint with this upgrade.
Need your help… I want a easier way to customize this plugin. Like the previous version.
Thank you…
The features from the version 1.0.0 has been migrated to the version 2.0.1 (Please update to 2.0.1 if you have not already, as there was a problem in 2.0.0). Also you don’t actually have to use the filter API. You can just select the pre-installed themes from the settings page (WP Admin > Settings > Category Posts) and use it through the Widget options (WP Admin > Widget).
Can you tell me why exactly are is this disappointing?
I find it difficult to customize the appearance. As a newbie in CSS, I look at php file, find classes, and then go to CSS file.
In 1.0.0, it was easier for me to find classes in php and go to css. I can customize the border, text, background, etc. But in new version, I can’t find where I should tweak this plugin.
I read CSS and Filter section, but I don’t understand what to do. (Forgive me, because I’m not a CSS master).
Would you mind give an example to do a customization for one of the theme?
In 1.0.0, I did this customization:
for wp_cat_list_theme:
———–
And then for light theme:
I see your problem. Basically the structure of the new version is in complete OOP. So, it will be hard to find! You can edit the existing CSS files from /static/css/ … Hope this helps. I will write a more detailed tutorial on how to add more theme using the theme’s function.php file.
oooohhh! Finally… Thank you! 🙂 Now I want to tweaking the class… What file should I tweak? I mean, what php file?
solved… 🙂 I found the right php file…
Instead of editing the php file, why dont you just add some classes and write your own css?
I think this is a great plugin. However it’s a little bit difficult to customized for me. I have given up. I’ve chosen WordPress because I’m not a web developer, I’ve designed my website using just my basic skills, just by taking advantage of the plugins. And I think it doesn’t look that bad: http://www.mystudentpathways.com/
My two cents: Considering that there are many people like me, It would be better to make this plugin easy for dumbs like me 🙂
What exactly is your problem? The options are there but you dont have to look at it if you want to use just the basic ones. From your widget section drag and drop a widget, enter title, select category, select css theme and that’s all. You don’t really have to worry about all the advanced customization, css classes, filter APIs etc 🙂
i like the widget before with css appearance, but the updated version don’t appear with css only showed the default css of my chosen current theme.
the strength of the plugin is css appearance ,but it lost now.
how can i get the css back?
Once you update you need to go to the widget (WP admin > appearance > widget) and select the css theme from the dropdown. In this version you can select different css for different widgets.
I’m out of my league on customizing this one. Can you give a more detailed description of how to add my css to this plug in? I love this plug in and would love for it to match my theme.
Can you post some examples or something?
Hi!
And thanks a bunch for a marvelous plugin, it is completely outstanding in many ways. And the best I’ve seen so far in its niche. But I cannot unfortunately not use it due to its limitations to define what status of the post, namely the WP_Querys args: “post_status”. I’m in need of a simple future posts lists, this case “future” Just add this, for instance as a drop down with the possible flags, any, future, drafts etc.
Do this and I will worship you and use the buy you a beer function!!!
/David
Hey! Great plug-in, exactly what I was looking for! Expect for the fact that the ‘Number of Posts to show’ doesn’t work. I don’t have ‘sticky’ posts, i put 3 posts to show, but the widget shows all the posts. Am I doing something wrong?
Could you help with with a small code change? I just want to remove the title=”” for the thumbs as i am using them as a full background image with text over the top. Couldn’t find what to remove in the php files.
This plugin is EXACTLY what I need. My Need: When you are viewing a Post that is “Category X”, the sidebar widget area shows other “Category X” posts. The only issue I have is most of our post have 2 categories, “Category X” and “Category Y”. Currently when I choose the “Category” option in the widget as “Current Category As Post” it only shows the 1st category that is selected. i.e. “Category X”. . .”Category Y” is missing from the list. Is there a way to show all related categories?
Thanks I will try this plugin.
the entry post isn’t showing the html code, just the format of the post entry. How do I fix it?
The widget option has the ability to specify no “theme” i.e. don’t include additional CSS when using this and use the theme CSS – which is what I’d guess most people want to do. But there’s seeingly no shortcode option to turn off the styling that comes with this plugin so that post listings adopt the standard theme styling. Can this be accomplished?
My real theme already has all the styling I need setup so I don’t need or want to respecify it for this plugin. I just need to use this plugin for filerting not styling.
Love the plugin!
It would be great if you could add in a hook that I could use in functions.php in my theme to display custom content in the $post_output.
As an example, at http://boldprogressives.org, the center column below the slider uses this plugin, but the text below the title is generated from custom fields on each post. I’ve had to modify the plugin directly to add in this functionality, but would be great if I could hook in via functions.php instead. Right now, I can’t update the plugin, otherwise I lose my custom code. With a function hook, no problem for updates!
I cannot get the thumbnails to show up using the shortcode. The post and excerpts show up no problem. I include is_thumb=”true” in the shortcode and nothing happens. I also tried is_thumb=true without success.
I am using the Suffusion theme by Sayontan Shinha if that has any bearing on what is happening. I did try regenerate thumbnails on a test post but it didn’t seem to help.
Here is the complete shortcode as it is now.
[wp_cpl_sc is_thumb="true" cat_id=21 sort_using=4 list_num=20 css_theme=0]
and here is link to the page showing the post list and excerpt, but no thumbnail.
http://www.happehtheory.com/HappehHealthSystem/strong-energy-index/
Thank You
It works now after putting an image in the “featured image” section. I expected it to take the first picture in the post to use for the thumbnail.
Is there a way to make the shortcode use the first picture of the post instead of needing a Featured Image?
Thank You
Hi, thanx for your work, i use shortcode to display posts on pages, but posts are not classed by date.
[wp_cpl_sc cat_id=27 list_num=4 show_author="false" show_date="false" show_comments="false" css_theme=0 sticky_post="79"]
Recents posts are below olds posts, how change this ?
Thanx a lot
Hi Swashata! How can customise the text from “Continue reading” to ‘Read more’ for shortcode?
Hello, is it possible to have a po-file for doing translations? I need it for using the plugin in french and german.
Sunny greetings from the south of France
Excellent plugin. I’ve looking fot this for years, to automatically list posts of the category which any visited post belongs to.
But I need to do the same inside posts, as a list under each post, but what is the code for auto category, like how it works in the sidebar. This is not mentioned in the plugin options. There are instructions for typing the cat ID, but no mention of auto category listing (so that I can add the code in the template for all posts)..
So what is the code to add in the post template please?
hi,
like your plugin 😉
one issue: i’m working with qtranslate for multi-language content (de, en, ru). the problem: plugin shows language news-titles together/at once…
strange: it works for the category title!
any simple sollution?
thanks, niky
I installed this widget recently but am having issues when I add a date. I don’t want any other info (author, etc.), just the date but I get this error message for each post:
Warning: _() expects exactly 1 parameter, 2 given in /home/wersh547/public_html/main/wp-content/plugins/wp-category-posts-list/includes/wp_cpl_output_gen.php on line 256
Can you help please?
Hi
I recently start to use the plugin and 1´m really loving it. To be perfect for me, i only need the possibility the select the posts by 2 category in the shortcode, i.e, the posts who belongs to 2 different category’s
It’s that possible with this version?
Thanks in advance.
Paulo Correia
great widget, however I’m getting the following error:
Warning: _() expects exactly 1 parameter, 2 given in /home/tpsnatio/public_html/wp-content/plugins/wp-category-posts-list/includes/wp_cpl_output_gen.php on line 256
any tips on how to fix?
hello! can i include posts from custom taxonomies like All-in-One Event Calendar in post list?
Great plugin! Just what I was looking for but can you tell me if there is anyway the plugin will select the category from more then just a post? The post works great but I’d like to have a CPL when browsing a category or even author posts….. Any thoughts?
How can I change this: [wp_cpl_sc cat_id=40 list_num=4 css_theme=2 sticky_post="79"] into
??
sorry, into phptag php wp_list_categories(‘exclude=40&show_count=1&title_li=’); phptag
Is there a method to add pagination of list when I use it by shortcode on post,page?
hi there, im need to change the .wp-cpl-sc-readmore(continue reading…) i need to change it for another text, thanks.
I love the idea of this widget – it’s just what I need – I just wish that you had a way to create the shortcode by entering parameters in the way the widget parameters are entered.
I really need the listing to be in the page (short code).
I used the widget for my first category list and it worked perfectly.
I tried a short code and it’s a mess. It’s not using my custom excerpt, has lots of extra lines and white space. If I could get it to look like your example I would be happy.
http://campbellvilleleadership.org/?page_id=14
[wp_cpl_sc cat_id=4 list_num=4 css_theme=0 sort_using=4 show_comments="false" show_date="false" show_author="false" option_excerpt="true"]