List category posts - Version 0.23

Version Description

This update is dedicated to Michelle K McGinnis who bought me "Diamond Age" by Neal Stephenson from my Amazon Wishlist. Thanks! :D

  • 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.
Download this release

Release Info

Developer fernandobt
Plugin Icon 128x128 List category posts
Version 0.23
Comparing to
See all releases

Code changes from version 0.22.3 to 0.23

include/CatList.php CHANGED
@@ -208,12 +208,11 @@ class CatList{
208
  public function get_excerpt($single){
209
  if ($this->params['excerpt']=='yes' && !($this->params['content']=='yes' && $single->post_content) ){
210
  if($single->post_excerpt){
211
- return $single->post_excerpt;
212
  }
213
  $lcp_excerpt = strip_tags($single->post_content);
214
- if (strlen($lcp_excerpt) > 255) {
215
- $lcp_excerpt = substr($lcp_excerpt, 0, 252) . '...';
216
- }
217
  return $lcp_excerpt;
218
  } else {
219
  return null;
208
  public function get_excerpt($single){
209
  if ($this->params['excerpt']=='yes' && !($this->params['content']=='yes' && $single->post_content) ){
210
  if($single->post_excerpt){
211
+ return $single->post_excerpt;
212
  }
213
  $lcp_excerpt = strip_tags($single->post_content);
214
+ $exc_lim = intval($this->params['excerpt_size']);
215
+ $lcp_excerpt = substr($lcp_excerpt, 0, $exc_lim) . '...';
 
216
  return $lcp_excerpt;
217
  } else {
218
  return null;
include/CatListDisplayer.php CHANGED
@@ -61,15 +61,20 @@ class CatListDisplayer {
61
  $inner_tag = ($tag == 'ul') ? 'li' : 'p';
62
  //Posts loop
63
  foreach ($this->catlist->get_categories_posts() as $single):
64
- if ( !post_password_required($single) ){
65
- $this->lcp_output .= $this->lcp_build_post($single, $inner_tag);
66
- }
67
  endforeach;
68
  $this->lcp_output .= '</' . $tag . '>';
69
 
70
  if (!empty($this->params['morelink'])):
71
- $this->lcp_output .= '<a href="' . get_category_link($this->catlist->get_category_id()) . '">'
72
- . $this->params['morelink'] . '</a>';
 
 
 
 
 
73
  endif;
74
 
75
 
@@ -88,13 +93,13 @@ class CatListDisplayer {
88
  $class = " class = current ";
89
  endif;
90
  $lcp_display_output = '<'. $tag . $class . '>';
91
- $lcp_display_output .= $this->get_post_title($single);
92
 
93
- $lcp_display_output .= $this->get_comments($single) . ' ';
94
 
95
- $lcp_display_output .= $this->get_date($single) . ' ';
96
 
97
- $lcp_display_output .= $this->get_author($single) . ' ';
98
 
99
  if (isset($this->params['customfield_display'])){
100
  $lcp_display_output .= $this->get_custom_fields($this->params['customfield_display'], $single->ID);
@@ -104,7 +109,7 @@ class CatListDisplayer {
104
 
105
  $lcp_display_output .= $this->get_content($single, 'p');
106
 
107
- $lcp_display_output .= $this->get_excerpt($single, 'p', 'lcp_excerpt');
108
 
109
  $lcp_display_output .= '</' . $tag . '>';
110
 
@@ -114,17 +119,17 @@ class CatListDisplayer {
114
  /**
115
  * Auxiliary functions for templates
116
  */
117
- private function get_author($single, $tag = null, $css_class = null){
118
  $info = $this->catlist->get_author_to_show($single);
119
  return $this->assign_style($info, $tag, $css_class);
120
  }
121
 
122
- private function get_comments($single, $tag = null, $css_class = null){
123
  $info = $this->catlist->get_comments_count($single);
124
  return $this->assign_style($info, $tag, $css_class);
125
  }
126
 
127
- private function get_content($single, $tag = null, $css_class = null){
128
  $info = $this->catlist->get_content($single);
129
  return $this->assign_style($info, $tag, $css_class);
130
  }
@@ -141,6 +146,7 @@ class CatListDisplayer {
141
 
142
  private function get_excerpt($single, $tag = null, $css_class = null){
143
  $info = $this->catlist->get_excerpt($single);
 
144
  return $this->assign_style($info, $tag, $css_class);
145
  }
146
 
@@ -155,7 +161,8 @@ class CatListDisplayer {
155
  }
156
 
157
  private function get_post_title($single, $tag = null, $css_class = null){
158
- return '<a href="' . get_permalink($single->ID).'">' . $single->post_title . '</a>';
 
159
  }
160
 
161
  private function get_category_link($tag = null, $css_class = null){
@@ -173,10 +180,10 @@ class CatListDisplayer {
173
  * @return string
174
  */
175
  private function assign_style($info, $tag = null, $css_class = null){
176
- if (!is_null($info)){
177
- if (is_null($tag)){
178
  return $info;
179
- } elseif (!is_null($tag) && is_null($css_class)) {
180
  return '<' . $tag . '>' . $info . '</' . $tag . '>';
181
  }
182
  return '<' . $tag . ' class="' . $css_class . '">' . $info . '</' . $tag . '>';
61
  $inner_tag = ($tag == 'ul') ? 'li' : 'p';
62
  //Posts loop
63
  foreach ($this->catlist->get_categories_posts() as $single):
64
+ if ( !post_password_required($single) ){
65
+ $this->lcp_output .= $this->lcp_build_post($single, $inner_tag);
66
+ }
67
  endforeach;
68
  $this->lcp_output .= '</' . $tag . '>';
69
 
70
  if (!empty($this->params['morelink'])):
71
+ $href = 'href="' . get_category_link($this->catlist->get_category_id()) . '"';
72
+ $class = "";
73
+ if (!empty($this->params['morelink_class'])):
74
+ $class = 'class="' . $this->params['morelink_class'] . '" ';
75
+ endif;
76
+ $readmore = $this->params['morelink'];
77
+ $this->lcp_output .= '<a ' . $href . ' ' . $class . ' >' . $readmore . '</a>';
78
  endif;
79
 
80
 
93
  $class = " class = current ";
94
  endif;
95
  $lcp_display_output = '<'. $tag . $class . '>';
96
+ $lcp_display_output .= $this->get_post_title($single, $this->params['title_tag'], $this->params['title_class']);
97
 
98
+ $lcp_display_output .= $this->get_comments($single, $this->params['comments_tag'], $this->params['comments_class']) . ' ';
99
 
100
+ $lcp_display_output .= $this->get_date($single, $this->params['date_tag'], $this->params['date_class']) . ' ';
101
 
102
+ $lcp_display_output .= $this->get_author($single, $this->params['author_tag'], $this->params['author_class']) . ' ';
103
 
104
  if (isset($this->params['customfield_display'])){
105
  $lcp_display_output .= $this->get_custom_fields($this->params['customfield_display'], $single->ID);
109
 
110
  $lcp_display_output .= $this->get_content($single, 'p');
111
 
112
+ $lcp_display_output .= $this->get_excerpt($single, $this->params['excerpt_tag'], $this->params['excerpt_class']);;
113
 
114
  $lcp_display_output .= '</' . $tag . '>';
115
 
119
  /**
120
  * Auxiliary functions for templates
121
  */
122
+ private function get_author($single, $tag, $css_class){
123
  $info = $this->catlist->get_author_to_show($single);
124
  return $this->assign_style($info, $tag, $css_class);
125
  }
126
 
127
+ private function get_comments($single, $tag, $css_class){
128
  $info = $this->catlist->get_comments_count($single);
129
  return $this->assign_style($info, $tag, $css_class);
130
  }
131
 
132
+ private function get_content($single, $tag, $css_class){
133
  $info = $this->catlist->get_content($single);
134
  return $this->assign_style($info, $tag, $css_class);
135
  }
146
 
147
  private function get_excerpt($single, $tag = null, $css_class = null){
148
  $info = $this->catlist->get_excerpt($single);
149
+ $info = preg_replace('/\[.*\]/', '', $info);
150
  return $this->assign_style($info, $tag, $css_class);
151
  }
152
 
161
  }
162
 
163
  private function get_post_title($single, $tag = null, $css_class = null){
164
+ $info = '<a href="' . get_permalink($single->ID).'" >' . $single->post_title . '</a>';
165
+ return $this->assign_style($info, $tag, $css_class);
166
  }
167
 
168
  private function get_category_link($tag = null, $css_class = null){
180
  * @return string
181
  */
182
  private function assign_style($info, $tag = null, $css_class = null){
183
+ if (!empty($info)){
184
+ if (empty($tag)){
185
  return $info;
186
+ } elseif (!empty($tag) && empty($css_class)) {
187
  return '<' . $tag . '>' . $info . '</' . $tag . '>';
188
  }
189
  return '<' . $tag . ' class="' . $css_class . '">' . $info . '</' . $tag . '>';
list_cat_posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: 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 id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.22.3
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
@@ -42,20 +42,33 @@ class ListCategoryPosts{
42
  'order' => 'desc',
43
  'numberposts' => '5',
44
  'date' => 'no',
45
- 'author' => 'no',
 
46
  'dateformat' => get_option('date_format'),
 
 
 
47
  'template' => 'default',
48
  'excerpt' => 'no',
 
 
 
49
  'exclude' => '0',
50
  'excludeposts' => '0',
51
  'offset' => '0',
52
  'tags' => '',
53
  'content' => 'no',
54
  'catlink' => 'no',
 
 
55
  'comments' => 'no',
 
 
56
  'thumbnail' => 'no',
57
  'thumbnail_size' => 'thumbnail',
58
  'thumbnail_class' => '',
 
 
59
  'post_type' => '',
60
  'post_parent' => '0',
61
  'class' => 'lcp_catlist',
@@ -64,7 +77,8 @@ class ListCategoryPosts{
64
  'customfield_display' =>'',
65
  'taxonomy' => '',
66
  'categorypage' => '',
67
- 'morelink' => ''
 
68
  ), $atts);
69
 
70
  $catlist_displayer = new CatListDisplayer($atts);
3
  Plugin Name: List category posts
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: 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 id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.23
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
42
  'order' => 'desc',
43
  'numberposts' => '5',
44
  'date' => 'no',
45
+ 'date_tag' => '',
46
+ 'date_class' =>'',
47
  'dateformat' => get_option('date_format'),
48
+ 'author' => 'no',
49
+ 'author_tag' =>'',
50
+ 'author_class' => '',
51
  'template' => 'default',
52
  'excerpt' => 'no',
53
+ 'excerpt_size' => '255',
54
+ 'excerpt_tag' =>'',
55
+ 'excerpt_class' =>'',
56
  'exclude' => '0',
57
  'excludeposts' => '0',
58
  'offset' => '0',
59
  'tags' => '',
60
  'content' => 'no',
61
  'catlink' => 'no',
62
+ 'catlink_tag' =>'',
63
+ 'catlink_class' => '',
64
  'comments' => 'no',
65
+ 'comments_tag' => '',
66
+ 'comments_class' => '',
67
  'thumbnail' => 'no',
68
  'thumbnail_size' => 'thumbnail',
69
  'thumbnail_class' => '',
70
+ 'title_tag' => '',
71
+ 'title_class' => '',
72
  'post_type' => '',
73
  'post_parent' => '0',
74
  'class' => 'lcp_catlist',
77
  'customfield_display' =>'',
78
  'taxonomy' => '',
79
  'categorypage' => '',
80
+ 'morelink' => '',
81
+ 'morelink_class' => ''
82
  ), $atts);
83
 
84
  $catlist_displayer = new CatListDisplayer($atts);
readme.txt CHANGED
@@ -3,14 +3,16 @@ Contributors: fernandobt
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
- Tested up to: 3.3
7
- Stable tag: 0.22.3
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
11
 
12
  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! The [catlist] shortcode can be used as many times as needed with different arguments on each post/page.
13
 
 
 
14
  Great to use WordPress as a CMS, and create pages with several categories posts.
15
 
16
  It includes a widget which works pretty much the same as the plugin. Just add as many widgets as you want, and select all the available options from the Appearence > Widgets page.
@@ -90,6 +92,8 @@ You can use the *categorypage* parameter to make it detect the category id of th
90
 
91
  * **excerpt** - Display the post's excerpt. Default is 'no', use excerpt=yes to activate it.
92
 
 
 
93
  * **excludeposts** - IDs of posts to exclude from the list. Ex: [catlist excludeposts=12,52,37]
94
 
95
  * **offset** - You can displace or pass over one or more initial posts which would normally be collected by your query through the use of the offset parameter.
@@ -120,6 +124,25 @@ You can use the *categorypage* parameter to make it detect the category id of th
120
 
121
  * **morelink** - Include a "more" link to access the category archive for the category. The link is inserted after listing the posts. It receives a string of characters as a parameter which will be used as the text of the link. Example: [catlist id=38 morelink="Read more"]
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  == Template System ==
124
 
125
  Templates for the List Category Plugin are searched for in your WordPress theme's folder. You should create a folder named list-category-posts under 'wp-content/themes/your-theme-folder'. Template files are .php files.
@@ -134,7 +157,7 @@ You can have as many different templates as you want, and use them in different
134
  * **Instructions** on how to use the plugin: http://wordpress.org/extend/plugins/list-category-posts/other_notes/
135
  * **Template system** how to customize the way the posts are shown: http://wordpress.org/extend/plugins/list-category-posts/other_notes/. I am aware the Template System is not really friendly right now, I'll work on this whenever I get the time to work on the plugin for a while.
136
  * **New feature requests** - Contact me on fernando at picandocodigo dot net.
137
- * **Support** I've decided to use WordPress Answers (http://meta.wordpress.stackexchange.com/) as the place for support. It's a great place with a large community of WordPress users and developers. Just ask your question with the tag 'plugin-list-category-post'.
138
 
139
  * **FAQ**
140
 
@@ -165,64 +188,89 @@ Template system has changed. Custom templates should be stored in WordPress them
165
 
166
  == Changelog ==
167
 
168
- = 0.22.3=
 
 
 
 
 
 
 
 
 
169
  * Fixed thumbnail size parameter, added usage example on README.
170
  * Added space after author and date http://wordpress.org/support/topic/plugin-list-category-posts-space-required-after
171
 
172
  = 0.22.2 =
 
173
  * Fixed bug with the categorypage=yes param.
174
  * Tested with WordPress 3.3.
175
 
176
  = 0.22.1 =
 
177
  * Fixed accidentally deleted line which made the catlink=yes param not work.
178
 
179
  = 0.22 =
 
180
  * 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
181
  * Added *morelink* parameter, check Other notes for usage.
182
 
183
  = 0.21.2 =
 
184
  * Removed var_dump... (Sorry about that)
185
 
186
  = 0.21.1 =
 
187
  * Small fixes:
188
  * Used "empty()" function for some Strings instead of evaluating isset() and != ''.
189
  * Include parameters on the get_posts args only when they are set (post_parent among others).
190
 
191
  = 0.21 =
 
192
  * Added 'thumbnail_class' parameter, so you can set a CSS class to the thumbnail and style it.
193
 
194
  = 0.20.5 =
 
195
  * 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.
196
  * Now the name parameter accepts multiple categories too. Just use: `[catlist name=category1,category2]`
197
 
198
  = 0.20.4 =
 
199
  * Yet another bugfix, regarding nothing being displayed when using tags.
200
 
201
  = 0.20.3 =
 
202
  * Fixed category detection code, which created some messy bugs in some cases
203
 
204
  = 0.20.2 =
 
205
  * Minor bugfix release
206
 
207
  = 0.20.1 =
 
208
  * Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
209
 
210
  = 0.20 =
 
211
  * Added the possibility to list posts from the current post's category
212
  * Some fixes to documentation
213
 
214
  = 0.19.3 =
 
215
  * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
216
 
217
  = 0.19.2 =
 
218
  * Small fix, missing parameter for taxonomy.
219
 
220
  = 0.19.1 =
 
221
  * Added thumbnail to Widget.
222
  * Added thumbnail link to post (http://picod.net/33).
223
 
224
  = 0.19 =
225
- 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: http://www.amazon.com/gp/registry/wishlist/2HU1JYOF7DX5Q/ref=wl_web
 
226
 
227
  * 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
228
  * Added thumbnail_size parameter.
@@ -230,102 +278,129 @@ This update is dedicated to S. Keller from Switzerland who gave me "The Ultimate
230
  * Fixed widget, now it remembers saved options.
231
 
232
  = 0.18.3 =
 
233
  * Small excerpt fix, some readme file fixing too.
234
  * Not showing the_content for password protected posts.
235
 
236
  = 0.18.2 =
 
237
  * Small fixes. Should work for name parameter in all cases now.
238
 
239
  = 0.18.1 =
 
240
  * Added slug and name to the fetching of category id from previous update.
241
 
242
  = 0.18 =
 
243
  * Fixed category id bug. Reported and fixed by Eric Celeste - http://eric.clst.org, thanks!
244
  * Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
245
  * Added category link which wasn't working after previous big update.
246
 
247
  = 0.17.1 =
 
248
  * Fixed displaying of "Author:" even when not being called.
249
 
250
  = 0.17 =
 
251
  * Major rewrite. The whole code was rewritten using objects. It's easier now to develop for List Category Posts.
252
  * Both STYLESHEETPATH and TEMPLATEPATH are checked for templates.
253
 
254
  = 0.16.1 =
 
255
  * Fixed shortcode nesting.
256
 
257
  = 0.16 =
 
258
  * Changed STYLESHEETPATH to TEMPLATEPATH to point to the parent theme.
259
  * Added support to display custom fields. (http://picod.net/wp03)
260
  * Tested with WordPress 3.1 - http://wordpress.org/support/topic/399754
261
 
262
 
263
  = 0.15.1 =
 
264
  * Fixed a bug with undeclared variable. (Check http://picod.net/walcp, thanks Das!)
265
 
266
  = 0.15 =
 
267
  * Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
268
 
269
  = 0.14.1 =
 
270
  * 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.
271
 
272
  = 0.14 =
 
273
  * Added "post_type" and "post_parent" from the underlining "get_posts()" API to be usable within the short-code. By Martin Crawford, thanks!
274
  * 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 (http://wordpress.org/support/topic/plugin-list-category-posts-sharing-my-own-template-in-lcp).
275
  * Fixed "tags" parameter on the documentation, it used to say "tag", and the plugin looks for "tags".
276
 
277
  = 0.13.2 =
 
278
  * Fixed thumbnail code, added it to default.php template as example.
279
 
280
  = 0.13.1 =
 
281
  * Fixed broken dateformat.
282
 
283
  = 0.13 =
 
284
  * Show post thumbnails, should be tested, feedback on styling is welcome. Thanks to Sebastian from http://www.avantix.com.ar/
285
 
286
  = 0.12 =
 
287
  * Added comments count.
288
  * Updated readme file
289
 
290
  = 0.11.2 =
 
291
  * Another minimal bug fixed with the excerpt...
292
 
293
  = 0.11.1 =
 
294
  * Fixed small bug which made the excerpt show up everytime... (Sorry :S)
295
 
296
  = 0.11 =
 
297
  * Automatic excerpt added in case the user didn't specifically write an excerpt.
298
  * Widget has been finally fixed. The attributes finally save themselves, and the widget works as expected :D
299
 
300
 
301
  = 0.10.1 =
302
- * Small fix - added ul tags to default template.
 
303
  * Compatible WordPress 3.0 with Twenty Ten theme (thanks again Doug Joseph :) )
304
 
305
  = 0.10 =
 
306
  * Code for the_content was fixed so that the content to output filtered content (thanks DougJoseph http://wordpress.org/support/topic/399754)
307
 
308
  = 0.9 =
 
309
  * admin parameter now shows "display name" instead of "user nice name".
310
  * 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)
311
  * Added tag support
312
 
313
  = 0.8.1 =
 
314
  * Fixed bug for 'content'.
315
  * There's new stuff on the widget options. I'm still working on it, so some bugs may appear.
316
 
317
  = 0.8 =
 
318
  * 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.
319
  * Updated readme file.
320
 
321
  = 0.7.2 =
 
322
  * Fixed link to category.
323
  * Improved template system.
324
 
325
  = 0.7.1 =
 
326
  * Fixed uber stupid bug with offset... Sorry about that!
327
 
328
  = 0.7 =
 
329
  * Exclude posts. Contribution by acub.
330
  * Offset parameter on shortcode to start listing posts with an offset. Contribution by Levi Vasquez
331
  * Content of the post can now be displayed. Contribution by Lang Zerner.
@@ -333,11 +408,13 @@ This update is dedicated to S. Keller from Switzerland who gave me "The Ultimate
333
  * Fixed small bug when using category name.
334
 
335
  = 0.6 =
 
336
  * Minor fix for unclosed ul if not using templates.
337
  * Added option to list posts from many categories at once.
338
  * Added option to exclude categories.
339
 
340
  = 0.5 =
 
341
  * Readme.txt validation.
342
  * Added 'excerpt' parameter. You can now show the excerpt for each post.
343
  * Added 'dateformat' parameter. Format of the date output. Default is get_option('date_format') - by Verex
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
+ Tested up to: 3.3.1
7
+ Stable tag: 0.23
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
11
 
12
  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! The [catlist] shortcode can be used as many times as needed with different arguments on each post/page.
13
 
14
+ **New feature**: The different elements to display con now be styled with CSS. you can define an HTML tag to wrap the element with, and a CSS class for this tag. Check [Other Notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for usage.
15
+
16
  Great to use WordPress as a CMS, and create pages with several categories posts.
17
 
18
  It includes a widget which works pretty much the same as the plugin. Just add as many widgets as you want, and select all the available options from the Appearence > Widgets page.
92
 
93
  * **excerpt** - Display the post's excerpt. Default is 'no', use excerpt=yes to activate it.
94
 
95
+ * **excerpt_size** - Set the number of characters to display from the excerpt. Default is 255. Eg: `excerpt_size = 300`
96
+
97
  * **excludeposts** - IDs of posts to exclude from the list. Ex: [catlist excludeposts=12,52,37]
98
 
99
  * **offset** - You can displace or pass over one or more initial posts which would normally be collected by your query through the use of the offset parameter.
124
 
125
  * **morelink** - Include a "more" link to access the category archive for the category. The link is inserted after listing the posts. It receives a string of characters as a parameter which will be used as the text of the link. Example: [catlist id=38 morelink="Read more"]
126
 
127
+ == HTML & CSS Customization ==
128
+
129
+ You can customize what HTML tags different elements will be sorrounded with and a CSS class for this element. The customizable elements are: author, catlink (category link), comments, date, excerpt, morelink ("Read More" link), thumbnail and title (post title).
130
+
131
+ The parameters are:
132
+ `autor_tag, author_class, catlink_tag, catlink_class, comments_tag, comments_class, date_tag, date_class,
133
+ excerpt_tag, excerpt_class, morelink_class, thumbnail_class, title_tag, title_class`
134
+
135
+ So for example, let's say you want to wrap the displayed comments count with the p tag and a "lcp_comments" class, you would do:
136
+ `[catlist id=7 comments=yes comments_tag=p comments_class=lcp_comments]`
137
+ This would produce the following code:
138
+ `<p class="lcp_comments"> (3)</p>`
139
+
140
+ Or you just want to style the displayed date, you could wrap it with a span tag:
141
+ `[catlist name=blog date=yes date_tag=span date_class=lcp_date]`
142
+ This would produce the following code:
143
+ `<span class="lcp_date">March 21, 2011</span>`
144
+
145
+
146
  == Template System ==
147
 
148
  Templates for the List Category Plugin are searched for in your WordPress theme's folder. You should create a folder named list-category-posts under 'wp-content/themes/your-theme-folder'. Template files are .php files.
157
  * **Instructions** on how to use the plugin: http://wordpress.org/extend/plugins/list-category-posts/other_notes/
158
  * **Template system** how to customize the way the posts are shown: http://wordpress.org/extend/plugins/list-category-posts/other_notes/. I am aware the Template System is not really friendly right now, I'll work on this whenever I get the time to work on the plugin for a while.
159
  * **New feature requests** - Contact me on fernando at picandocodigo dot net.
160
+ * **Support** I've decided to use [WordPress Answers](http://wordpress.stackexchange.com/) as the place for support. It's a great place with a large community of WordPress users and developers. Just [ask your question](http://wordpress.stackexchange.com/questions/ask?tags=plugin-list-category-posts) using the 'plugin-list-category-post' tag.
161
 
162
  * **FAQ**
163
 
188
 
189
  == Changelog ==
190
 
191
+ = 0.23 =
192
+
193
+ This update is dedicated to [Michelle K McGinnis](http://friendlywebconsulting.com/) who bought me "Diamond Age" by Neal Stephenson from my [Amazon Wishlist](http://www.amazon.com/gp/registry/wishlist/2HU1JYOF7DX5Q/ref=wl_web). Thanks! :D
194
+
195
+ * Added excerpt size. You can set how many characters you want the excerpt to display with 'excerpt_size'.
196
+ * Fixed HTML tag and CSS class for each element (Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for usage).
197
+ * Removed shortcodes from excerpt.
198
+
199
+ = 0.22.3 =
200
+
201
  * Fixed thumbnail size parameter, added usage example on README.
202
  * Added space after author and date http://wordpress.org/support/topic/plugin-list-category-posts-space-required-after
203
 
204
  = 0.22.2 =
205
+
206
  * Fixed bug with the categorypage=yes param.
207
  * Tested with WordPress 3.3.
208
 
209
  = 0.22.1 =
210
+
211
  * Fixed accidentally deleted line which made the catlink=yes param not work.
212
 
213
  = 0.22 =
214
+
215
  * 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
216
  * Added *morelink* parameter, check Other notes for usage.
217
 
218
  = 0.21.2 =
219
+
220
  * Removed var_dump... (Sorry about that)
221
 
222
  = 0.21.1 =
223
+
224
  * Small fixes:
225
  * Used "empty()" function for some Strings instead of evaluating isset() and != ''.
226
  * Include parameters on the get_posts args only when they are set (post_parent among others).
227
 
228
  = 0.21 =
229
+
230
  * Added 'thumbnail_class' parameter, so you can set a CSS class to the thumbnail and style it.
231
 
232
  = 0.20.5 =
233
+
234
  * 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.
235
  * Now the name parameter accepts multiple categories too. Just use: `[catlist name=category1,category2]`
236
 
237
  = 0.20.4 =
238
+
239
  * Yet another bugfix, regarding nothing being displayed when using tags.
240
 
241
  = 0.20.3 =
242
+
243
  * Fixed category detection code, which created some messy bugs in some cases
244
 
245
  = 0.20.2 =
246
+
247
  * Minor bugfix release
248
 
249
  = 0.20.1 =
250
+
251
  * Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
252
 
253
  = 0.20 =
254
+
255
  * Added the possibility to list posts from the current post's category
256
  * Some fixes to documentation
257
 
258
  = 0.19.3 =
259
+
260
  * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
261
 
262
  = 0.19.2 =
263
+
264
  * Small fix, missing parameter for taxonomy.
265
 
266
  = 0.19.1 =
267
+
268
  * Added thumbnail to Widget.
269
  * Added thumbnail link to post (http://picod.net/33).
270
 
271
  = 0.19 =
272
+
273
+ 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](http://www.amazon.com/gp/registry/wishlist/2HU1JYOF7DX5Q/ref=wl_web):
274
 
275
  * 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
276
  * Added thumbnail_size parameter.
278
  * Fixed widget, now it remembers saved options.
279
 
280
  = 0.18.3 =
281
+
282
  * Small excerpt fix, some readme file fixing too.
283
  * Not showing the_content for password protected posts.
284
 
285
  = 0.18.2 =
286
+
287
  * Small fixes. Should work for name parameter in all cases now.
288
 
289
  = 0.18.1 =
290
+
291
  * Added slug and name to the fetching of category id from previous update.
292
 
293
  = 0.18 =
294
+
295
  * Fixed category id bug. Reported and fixed by Eric Celeste - http://eric.clst.org, thanks!
296
  * Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
297
  * Added category link which wasn't working after previous big update.
298
 
299
  = 0.17.1 =
300
+
301
  * Fixed displaying of "Author:" even when not being called.
302
 
303
  = 0.17 =
304
+
305
  * Major rewrite. The whole code was rewritten using objects. It's easier now to develop for List Category Posts.
306
  * Both STYLESHEETPATH and TEMPLATEPATH are checked for templates.
307
 
308
  = 0.16.1 =
309
+
310
  * Fixed shortcode nesting.
311
 
312
  = 0.16 =
313
+
314
  * Changed STYLESHEETPATH to TEMPLATEPATH to point to the parent theme.
315
  * Added support to display custom fields. (http://picod.net/wp03)
316
  * Tested with WordPress 3.1 - http://wordpress.org/support/topic/399754
317
 
318
 
319
  = 0.15.1 =
320
+
321
  * Fixed a bug with undeclared variable. (Check http://picod.net/walcp, thanks Das!)
322
 
323
  = 0.15 =
324
+
325
  * Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
326
 
327
  = 0.14.1 =
328
+
329
  * 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.
330
 
331
  = 0.14 =
332
+
333
  * Added "post_type" and "post_parent" from the underlining "get_posts()" API to be usable within the short-code. By Martin Crawford, thanks!
334
  * 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 (http://wordpress.org/support/topic/plugin-list-category-posts-sharing-my-own-template-in-lcp).
335
  * Fixed "tags" parameter on the documentation, it used to say "tag", and the plugin looks for "tags".
336
 
337
  = 0.13.2 =
338
+
339
  * Fixed thumbnail code, added it to default.php template as example.
340
 
341
  = 0.13.1 =
342
+
343
  * Fixed broken dateformat.
344
 
345
  = 0.13 =
346
+
347
  * Show post thumbnails, should be tested, feedback on styling is welcome. Thanks to Sebastian from http://www.avantix.com.ar/
348
 
349
  = 0.12 =
350
+
351
  * Added comments count.
352
  * Updated readme file
353
 
354
  = 0.11.2 =
355
+
356
  * Another minimal bug fixed with the excerpt...
357
 
358
  = 0.11.1 =
359
+
360
  * Fixed small bug which made the excerpt show up everytime... (Sorry :S)
361
 
362
  = 0.11 =
363
+
364
  * Automatic excerpt added in case the user didn't specifically write an excerpt.
365
  * Widget has been finally fixed. The attributes finally save themselves, and the widget works as expected :D
366
 
367
 
368
  = 0.10.1 =
369
+ * Small fix -
370
+ added ul tags to default template.
371
  * Compatible WordPress 3.0 with Twenty Ten theme (thanks again Doug Joseph :) )
372
 
373
  = 0.10 =
374
+
375
  * Code for the_content was fixed so that the content to output filtered content (thanks DougJoseph http://wordpress.org/support/topic/399754)
376
 
377
  = 0.9 =
378
+
379
  * admin parameter now shows "display name" instead of "user nice name".
380
  * 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)
381
  * Added tag support
382
 
383
  = 0.8.1 =
384
+
385
  * Fixed bug for 'content'.
386
  * There's new stuff on the widget options. I'm still working on it, so some bugs may appear.
387
 
388
  = 0.8 =
389
+
390
  * 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.
391
  * Updated readme file.
392
 
393
  = 0.7.2 =
394
+
395
  * Fixed link to category.
396
  * Improved template system.
397
 
398
  = 0.7.1 =
399
+
400
  * Fixed uber stupid bug with offset... Sorry about that!
401
 
402
  = 0.7 =
403
+
404
  * Exclude posts. Contribution by acub.
405
  * Offset parameter on shortcode to start listing posts with an offset. Contribution by Levi Vasquez
406
  * Content of the post can now be displayed. Contribution by Lang Zerner.
408
  * Fixed small bug when using category name.
409
 
410
  = 0.6 =
411
+
412
  * Minor fix for unclosed ul if not using templates.
413
  * Added option to list posts from many categories at once.
414
  * Added option to exclude categories.
415
 
416
  = 0.5 =
417
+
418
  * Readme.txt validation.
419
  * Added 'excerpt' parameter. You can now show the excerpt for each post.
420
  * Added 'dateformat' parameter. Format of the date output. Default is get_option('date_format') - by Verex