List category posts - Version 0.20

Version Description

  • Added the possibility to list posts from the current post's category
  • Some fixes to documentation
Download this release

Release Info

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

Code changes from version 0.19.3 to 0.20

include/CatList.php CHANGED
@@ -24,10 +24,14 @@ class CatList{
24
  * Get the categories & posts
25
  */
26
  private function lcp_set_categories(){
27
- if($this->params['name'] != '' && $this->params['id'] == '0'){
28
  $this->lcp_category_id = $this->get_category_id_by_name($this->params['name']);
29
- }else{
30
  $this->lcp_category_id = $this->params['id'];
 
 
 
 
31
  }
32
 
33
  $args = array('cat'=> $this->lcp_category_id);
@@ -41,11 +45,11 @@ class CatList{
41
  ));
42
 
43
  // Post type and post parent:
44
- if($this->params['post_type']): $args['post_type'] = $this->params['post_type']; endif;
45
- if($this->params['post_parent']): $args['post_parent'] = $this->params['post_parent']; endif;
46
 
47
  // Custom fields 'customfield_name' & 'customfield_value' should both be defined
48
- if($this->params['customfield_name']!='' && $this->params['customfield_value'] != ''):
49
  $args['meta_key'] = $this->params['customfield_name'];
50
  $args['meta_value'] = $this->params['customfield_value'];
51
  endif;
@@ -56,13 +60,13 @@ class CatList{
56
  }
57
 
58
  // Added custom taxonomy support
59
- if ($this->params['taxonomy'] != "" && $this->params['tags'] != "") {
60
  $args['tax_query'] = array(array(
61
  'taxonomy' => $this->params['taxonomy'],
62
  'field' => 'slug',
63
  'terms' => explode(",",$this->params['tags'])
64
  ));
65
- } elseif ($this->params['tags'] != "") {
66
  $args['tag'] = $this->params['tags'];
67
  }
68
 
@@ -135,7 +139,7 @@ class CatList{
135
  }
136
 
137
  public function get_comments_count($single){
138
- if ($this->params['comments'] == 'yes'){
139
  return ' (' . $single->comment_count . ')';
140
  } else {
141
  return null;
@@ -163,7 +167,7 @@ class CatList{
163
  }
164
 
165
  public function get_content($single){
166
- if ($this->params['content']=='yes' && $single->post_content){
167
  $lcp_content = $single->post_content;
168
  //Need to put some more thought on this!
169
  //Added to stop a post with catlist to display an infinite loop of catlist shortcode parsing
24
  * Get the categories & posts
25
  */
26
  private function lcp_set_categories(){
27
+ if(isset($this->params['name']) && $this->params['name'] != ''){
28
  $this->lcp_category_id = $this->get_category_id_by_name($this->params['name']);
29
+ }elseif (isset($this->params['id']) && $this->params['id'] != '0'){
30
  $this->lcp_category_id = $this->params['id'];
31
+ } else {
32
+ global $post;
33
+ $categories = get_the_category($post->ID);
34
+ $this->lcp_category_id = $categories[0]->cat_ID;
35
  }
36
 
37
  $args = array('cat'=> $this->lcp_category_id);
45
  ));
46
 
47
  // Post type and post parent:
48
+ if(isset($this->params['post_type'])): $args['post_type'] = $this->params['post_type']; endif;
49
+ if(isset($this->params['post_parent'])): $args['post_parent'] = $this->params['post_parent']; endif;
50
 
51
  // Custom fields 'customfield_name' & 'customfield_value' should both be defined
52
+ if(isset($this->params['customfield_name']) && $this->params['customfield_value'] != ''):
53
  $args['meta_key'] = $this->params['customfield_name'];
54
  $args['meta_value'] = $this->params['customfield_value'];
55
  endif;
60
  }
61
 
62
  // Added custom taxonomy support
63
+ if (isset($this->params['taxonomy']) && $this->params['tags'] != "") {
64
  $args['tax_query'] = array(array(
65
  'taxonomy' => $this->params['taxonomy'],
66
  'field' => 'slug',
67
  'terms' => explode(",",$this->params['tags'])
68
  ));
69
+ } elseif (isset($this->params['tags'])) {
70
  $args['tag'] = $this->params['tags'];
71
  }
72
 
139
  }
140
 
141
  public function get_comments_count($single){
142
+ if (isset($this->params['comments']) && $this->params['comments'] == 'yes'){
143
  return ' (' . $single->comment_count . ')';
144
  } else {
145
  return null;
167
  }
168
 
169
  public function get_content($single){
170
+ if (isset($this->params['content']) && $this->params['content'] =='yes' && $single->post_content){
171
  $lcp_content = $single->post_content;
172
  //Need to put some more thought on this!
173
  //Added to stop a post with catlist to display an infinite loop of catlist shortcode parsing
include/CatListDisplayer.php CHANGED
@@ -55,7 +55,9 @@ class CatListDisplayer {
55
 
56
  private function build_output($tag){
57
  $this->lcp_output .= $this->get_category_link('strong');
58
- $this->lcp_output .= '<' . $tag . ' class="'.$this->params['class'].'">';
 
 
59
  $inner_tag = ($tag == 'ul') ? 'li' : 'p';
60
  //Posts loop
61
  foreach ($this->catlist->get_categories_posts() as $single):
@@ -81,9 +83,10 @@ class CatListDisplayer {
81
  $lcp_display_output .= ' ' . $this->get_date($single);
82
 
83
  $lcp_display_output .= $this->get_author($single);
84
-
85
- $lcp_display_output .= $this->get_custom_fields($this->params['customfield_display'], $single->ID);
86
-
 
87
  $lcp_display_output .= $this->get_thumbnail($single);
88
 
89
  $lcp_display_output .= $this->get_content($single, 'p');
55
 
56
  private function build_output($tag){
57
  $this->lcp_output .= $this->get_category_link('strong');
58
+ $this->lcp_output .= '<' . $tag;
59
+ if (isset($this->params['class'])): $this->lcp_output .= ' class="'.$this->params['class']; endif;
60
+ $this->lcp_output .= '">';
61
  $inner_tag = ($tag == 'ul') ? 'li' : 'p';
62
  //Posts loop
63
  foreach ($this->catlist->get_categories_posts() as $single):
83
  $lcp_display_output .= ' ' . $this->get_date($single);
84
 
85
  $lcp_display_output .= $this->get_author($single);
86
+
87
+ if (isset($this->params['customfield_display'])){
88
+ $lcp_display_output .= $this->get_custom_fields($this->params['customfield_display'], $single->ID);
89
+ }
90
  $lcp_display_output .= $this->get_thumbnail($single);
91
 
92
  $lcp_display_output .= $this->get_content($single, 'p');
include/ListCategoryPostsWidget.php CHANGED
@@ -8,7 +8,7 @@ require_once 'CatListDisplayer.php';
8
  class ListCategoryPostsWidget extends WP_Widget{
9
 
10
  function ListCategoryPostsWidget() {
11
- $opts = array('description' => '');
12
  parent::WP_Widget(false, $name = 'List Category Posts', $opts);
13
  }
14
 
@@ -53,7 +53,6 @@ class ListCategoryPostsWidget extends WP_Widget{
53
 
54
  $catlist_displayer = new CatListDisplayer($atts);
55
  echo $catlist_displayer->display();
56
- echo $lcp_result;
57
  echo $after_widget;
58
  }
59
 
@@ -87,4 +86,8 @@ class ListCategoryPostsWidget extends WP_Widget{
87
  }
88
 
89
  add_action('widgets_init', create_function('', 'return register_widget("listCategoryPostsWidget");'));
 
 
 
 
90
  ?>
8
  class ListCategoryPostsWidget extends WP_Widget{
9
 
10
  function ListCategoryPostsWidget() {
11
+ $opts = array('description' => 'List posts from a specified category');
12
  parent::WP_Widget(false, $name = 'List Category Posts', $opts);
13
  }
14
 
53
 
54
  $catlist_displayer = new CatListDisplayer($atts);
55
  echo $catlist_displayer->display();
 
56
  echo $after_widget;
57
  }
58
 
86
  }
87
 
88
  add_action('widgets_init', create_function('', 'return register_widget("listCategoryPostsWidget");'));
89
+
90
+ #Working on i18n, if you want to give a hand visit: http://wordpress.stackexchange.com/questions/32339/widget-translation-on-my-plugin
91
+ #$translation_dir = '../languages';
92
+ #load_plugin_textdomain( 'list-category-posts', null, $translation_dir );
93
  ?>
include/lcp_widget_form.php CHANGED
@@ -15,98 +15,98 @@ $instance = wp_parse_args( (array) $instance, array(
15
  'show_excerpt'=>'',
16
  'exclude'=>'',
17
  'excludeposts'=>'',
18
- 'thumbnail' =>'',
19
  'offset'=>'',
20
  'show_catlink'=>'' ) );
21
  $title = strip_tags($instance['title']);
22
  $limit = strip_tags($instance['limit']);
23
  $orderby = strip_tags($instance['orderby']);
24
  $order = strip_tags($instance['order']);
25
- $showdate = strip_tags($instance['showdate']);
26
- $showauthor = strip_tags($instance['author']);
27
  $exclude = strip_tags($instance['exclude']);
28
  $excludeposts = strip_tags($instance['excludeposts']);
29
  $offset = strip_tags($instance['offset']);
30
- $showcatlink = strip_tags($instance['catlink']);
31
  $categoryid = strip_tags($instance['categoryid']);
32
- $showexcerpt = strip_tags($instance['excerpt']);
33
  $thumbnail = strip_tags($instance['thumbnail']);
34
  $thumbnail_size = strip_tags($instance['thumbnail_size']);
35
  ?>
36
 
37
- <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e("Title")?></label>
38
  <br/>
39
- <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
40
- name="<?php echo $this->get_field_name('title'); ?>" type="text"
41
- value="<?php echo attribute_escape($title); ?>" />
42
  </p>
43
 
44
- <p><label for="<?php echo $this->get_field_id('categoryid'); ?>"><?php _e("Category")?></label>
45
  <br/>
46
  <select id="<?php echo $this->get_field_id('categoryid'); ?>" name="<?php echo $this->get_field_name('categoryid'); ?>">
47
- <?php
48
- $categories= get_categories();
49
- foreach ($categories as $cat) :
50
- $option = '<option value="' . $cat->cat_ID . '" ';
51
- if ($cat->cat_ID == $categoryid) :
52
- $option .= ' selected = "selected" ';
53
- endif;
54
- $option .= '">';
55
- $option .= $cat->cat_name;
56
- $option .= '</option>';
57
- echo $option;
58
- endforeach;
59
- ?>
60
  </select></p>
61
 
62
- <p><label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e("Number of posts")?></label>
63
  <br/>
64
- <input size="2" id="<?php echo $this->get_field_id('limit'); ?>"
65
- name="<?php echo $this->get_field_name('limit'); ?>" type="text"
66
- value="<?php echo attribute_escape($limit); ?>" />
67
  </p>
68
 
69
- <p><label for="<?php echo $this->get_field_id('offset'); ?>">Offset: <br/>
70
- <input size="2" id="<?php echo $this->get_field_id('offset'); ?>"
71
- name="<?php echo $this->get_field_name('offset'); ?>" type="text"
72
- value="<?php echo attribute_escape($offset); ?>" />
73
  </label></p>
74
 
75
- <p><label for="<?php echo $this->get_field_id('orderby'); ?>">Order by</label> <br/>
76
- <select id="<?php echo $this->get_field_id('orderby'); ?>"
77
- name="<?php echo $this->get_field_name('orderby'); ?>" type="text" >
78
- <option value='date'>Date</option>
79
- <option value='title'>Post title</option>
80
- <option value='author'>Author</option>
81
- <option value='rand'>Random</option>
82
- </select>
83
  </p>
84
 
85
- <p><label for="<?php echo $this->get_field_id('order'); ?>">Order:</label><br/>
86
- <select id="<?php echo $this->get_field_id('order'); ?>"
87
- name="<?php echo $this->get_field_name('order'); ?>" type="text">
88
- <option value='desc'>Descending</option>
89
- <option value='asc'>Ascending</option>
90
- </select>
91
  </p>
92
 
93
- <p><label for="<?php echo $this->get_field_id('exclude'); ?>">Exclude categories (id's): </label><br/>
94
- <input id="<?php echo $this->get_field_id('exclude'); ?>"
95
- name="<?php echo $this->get_field_name('exclude'); ?>" type="text"
96
- value="<?php echo attribute_escape($exclude); ?>" />
97
  </p>
98
 
99
- <p><label for="<?php echo $this->get_field_id('excludeposts'); ?>">Exclude posts (id's): </label><br/>
100
- <input id="<?php echo $this->get_field_id('excludeposts'); ?>"
101
- name="<?php echo $this->get_field_name('excludeposts'); ?>" type="text"
102
- value="<?php echo attribute_escape($excludeposts); ?>" />
103
  </p>
104
 
105
 
106
- <label>Show: </label><br/>
107
  <p>
108
  <input type="checkbox" <?php checked( (bool) $instance['thumbnail'], true ); ?>
109
- name="<?php echo $this->get_field_name( 'thumbnail'); ?>" />Thumbnail - size:
110
  <select id="<?php echo $this->get_field_id('thumbnail_size'); ?>"
111
  name="<?php echo $this->get_field_name( 'thumbnail_size' ); ?>" type="text">
112
  <option value='thumbnail'>thumbnail</option>
@@ -117,18 +117,17 @@ $thumbnail_size = strip_tags($instance['thumbnail_size']);
117
  </p>
118
  <p>
119
  <input type="checkbox" <?php checked( (bool) $instance['show_date'], true ); ?>
120
- name="<?php echo $this->get_field_name( 'show_date' ); ?>" />Date
121
  </p>
122
  <p>
123
  <input type="checkbox" <?php checked( (bool) $instance['show_author'], true ); ?>
124
- name="<?php echo $this->get_field_name( 'show_author' ); ?>" />Author
125
  </p>
126
  <p>
127
  <input type="checkbox" <?php checked( (bool) $instance['show_catlink'], true ); ?>
128
- name="<?php echo $this->get_field_name( 'show_catlink' ); ?>" />Link to category
129
  </p>
130
  <p>
131
  <input type="checkbox" <?php checked( (bool) $instance['show_excerpt'], true ); ?>
132
- name="<?php echo $this->get_field_name( 'show_excerpt' ); ?>" />Excerpt
133
  </p>
134
-
15
  'show_excerpt'=>'',
16
  'exclude'=>'',
17
  'excludeposts'=>'',
18
+ 'thumbnail' =>'',
19
  'offset'=>'',
20
  'show_catlink'=>'' ) );
21
  $title = strip_tags($instance['title']);
22
  $limit = strip_tags($instance['limit']);
23
  $orderby = strip_tags($instance['orderby']);
24
  $order = strip_tags($instance['order']);
25
+ $showdate = strip_tags($instance['show_date']);
26
+ $showauthor = strip_tags($instance['show_author']);
27
  $exclude = strip_tags($instance['exclude']);
28
  $excludeposts = strip_tags($instance['excludeposts']);
29
  $offset = strip_tags($instance['offset']);
30
+ $showcatlink = strip_tags($instance['show_catlink']);
31
  $categoryid = strip_tags($instance['categoryid']);
32
+ $showexcerpt = strip_tags($instance['show_excerpt']);
33
  $thumbnail = strip_tags($instance['thumbnail']);
34
  $thumbnail_size = strip_tags($instance['thumbnail_size']);
35
  ?>
36
 
37
+ <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e("Title", 'list-category-posts')?></label>
38
  <br/>
39
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
40
+ name="<?php echo $this->get_field_name('title'); ?>" type="text"
41
+ value="<?php echo esc_attr($title); ?>" />
42
  </p>
43
 
44
+ <p><label for="<?php echo $this->get_field_id('categoryid'); ?>"><?php _e("Category", 'list-category-posts')?></label>
45
  <br/>
46
  <select id="<?php echo $this->get_field_id('categoryid'); ?>" name="<?php echo $this->get_field_name('categoryid'); ?>">
47
+ <?php
48
+ $categories= get_categories();
49
+ foreach ($categories as $cat) :
50
+ $option = '<option value="' . $cat->cat_ID . '" ';
51
+ if ($cat->cat_ID == $categoryid) :
52
+ $option .= ' selected = "selected" ';
53
+ endif;
54
+ $option .= '">';
55
+ $option .= $cat->cat_name;
56
+ $option .= '</option>';
57
+ echo $option;
58
+ endforeach;
59
+ ?>
60
  </select></p>
61
 
62
+ <p><label for="<?php echo $this->get_field_id('limit'); ?>"><?php _e("Number of posts", 'list-category-posts')?></label>
63
  <br/>
64
+ <input size="2" id="<?php echo $this->get_field_id('limit'); ?>"
65
+ name="<?php echo $this->get_field_name('limit'); ?>" type="text"
66
+ value="<?php echo esc_attr($limit); ?>" />
67
  </p>
68
 
69
+ <p><label for="<?php echo $this->get_field_id('offset'); ?>"><?php _e("Offset", 'list-category-posts')?>: <br/>
70
+ <input size="2" id="<?php echo $this->get_field_id('offset'); ?>"
71
+ name="<?php echo $this->get_field_name('offset'); ?>" type="text"
72
+ value="<?php echo esc_attr($offset); ?>" />
73
  </label></p>
74
 
75
+ <p><label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e("Order by", 'list-category-posts')?></label> <br/>
76
+ <select id="<?php echo $this->get_field_id('orderby'); ?>"
77
+ name="<?php echo $this->get_field_name('orderby'); ?>" type="text" >
78
+ <option value='date'><?php _e("Date", 'list-category-posts')?></option>
79
+ <option value='title'><?php _e("Post title", 'list-category-posts')?></option>
80
+ <option value='author'><?php _e("Author", 'list-category-posts')?></option>
81
+ <option value='rand'><?php _e("Random", 'list-category-posts')?></option>
82
+ </select>
83
  </p>
84
 
85
+ <p><label for="<?php echo $this->get_field_id('order'); ?>"><?php _e("Order", 'list-category-posts')?></label><br/>
86
+ <select id="<?php echo $this->get_field_id('order'); ?>"
87
+ name="<?php echo $this->get_field_name('order'); ?>" type="text">
88
+ <option value='desc'><?php _e("Descending", 'list-category-posts')?></option>
89
+ <option value='asc'><?php _e("Ascending", 'list-category-posts')?></option>
90
+ </select>
91
  </p>
92
 
93
+ <p><label for="<?php echo $this->get_field_id('exclude'); ?>"><?php _e("Exclude categories (id's)", 'list-category-posts')?></label><br/>
94
+ <input id="<?php echo $this->get_field_id('exclude'); ?>"
95
+ name="<?php echo $this->get_field_name('exclude'); ?>" type="text"
96
+ value="<?php echo esc_attr($exclude); ?>" />
97
  </p>
98
 
99
+ <p><label for="<?php echo $this->get_field_id('excludeposts'); ?>"><?php _e("Exclude posts (id's)", 'list-category-posts')?></label><br/>
100
+ <input id="<?php echo $this->get_field_id('excludeposts'); ?>"
101
+ name="<?php echo $this->get_field_name('excludeposts'); ?>" type="text"
102
+ value="<?php echo esc_attr($excludeposts); ?>" />
103
  </p>
104
 
105
 
106
+ <label><?php _e("Show", 'list-category-posts')?>: </label><br/>
107
  <p>
108
  <input type="checkbox" <?php checked( (bool) $instance['thumbnail'], true ); ?>
109
+ name="<?php echo $this->get_field_name( 'thumbnail'); ?>" /><?php _e("Thumbnail - size", 'list-category-posts')?>
110
  <select id="<?php echo $this->get_field_id('thumbnail_size'); ?>"
111
  name="<?php echo $this->get_field_name( 'thumbnail_size' ); ?>" type="text">
112
  <option value='thumbnail'>thumbnail</option>
117
  </p>
118
  <p>
119
  <input type="checkbox" <?php checked( (bool) $instance['show_date'], true ); ?>
120
+ name="<?php echo $this->get_field_name( 'show_date' ); ?>" /><?php _e("Date", 'list-category-posts')?>
121
  </p>
122
  <p>
123
  <input type="checkbox" <?php checked( (bool) $instance['show_author'], true ); ?>
124
+ name="<?php echo $this->get_field_name( 'show_author' ); ?>" /><?php _e("Author", 'list-category-posts')?>
125
  </p>
126
  <p>
127
  <input type="checkbox" <?php checked( (bool) $instance['show_catlink'], true ); ?>
128
+ name="<?php echo $this->get_field_name( 'show_catlink' ); ?>" /><?php _e("Link to category", 'list-category-posts')?>
129
  </p>
130
  <p>
131
  <input type="checkbox" <?php checked( (bool) $instance['show_excerpt'], true ); ?>
132
+ name="<?php echo $this->get_field_name( 'show_excerpt' ); ?>" /><?php _e("Excerpt", 'list-category-posts')?>
133
  </p>
 
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.19.3
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
@@ -79,8 +79,6 @@ add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
79
  * From WordPress Answers:
80
  Add Older Posts at bottom of List Category Post page
81
  http://wordpress.stackexchange.com/questions/26398/add-older-posts-at-bottom-of-list-category-post-page
82
- Include the latest post of a specific category on a matching page
83
- http://wordpress.stackexchange.com/questions/26224/how-to-include-the-latest-post-of-a-specific-category-on-a-matching-page
84
  Getting the “more” tag to work with plugin-list-category-post
85
  http://wordpress.stackexchange.com/questions/30376/getting-the-more-tag-to-work-with-plugin-list-category-post
86
  - Fix the code for the WordPress Coding Standards: http://codex.wordpress.org/WordPress_Coding_Standards
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.20
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
  */
79
  * From WordPress Answers:
80
  Add Older Posts at bottom of List Category Post page
81
  http://wordpress.stackexchange.com/questions/26398/add-older-posts-at-bottom-of-list-category-post-page
 
 
82
  Getting the “more” tag to work with plugin-list-category-post
83
  http://wordpress.stackexchange.com/questions/30376/getting-the-more-tag-to-work-with-plugin-list-category-post
84
  - Fix the code for the WordPress Coding Standards: http://codex.wordpress.org/WordPress_Coding_Standards
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
  Tested up to: 3.2.1
7
- Stable tag: 0.19.3
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
@@ -13,14 +13,18 @@ The shortcode accepts a category name or id, the order in which you want the pos
13
 
14
  Great to use WordPress as a CMS, and create pages with several categories posts.
15
 
16
- The plugin 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.
17
 
18
- Since version 0.18, **this plugins does not work on server with PHP 4**. If you're still using PHP 4 on your webhost, you should consider upgrading to PHP 5. WordPress 3.1 will be the last version to support PHP 4, from 3.2 and forward, only PHP 5 will be supported. You can still [download an older version of the plugin](https://wordpress.org/extend/plugins/list-category-posts/download/ "download an older version of the plugin") if you're using PHP 4.
19
 
20
  Works correctly with WordPress 3.1 and default Twenty Ten theme
21
  (http://wordpress.org/support/topic/399754)
22
 
23
- **Usage**: `[catlist argument1=value1 argument2=value2]`
 
 
 
 
24
 
25
  **Support the plugin**
26
 
@@ -37,12 +41,16 @@ If you've found the plugin useful, consider making a [donation via PayPal](http:
37
  ==Other notes==
38
 
39
  **Usage**
40
- The arguments you can use are:
 
 
 
41
 
42
  * **name** - To display posts from a category using the category's name. Ex: [catlist name=mycategory]
43
 
44
  * **id** - To display posts from a category using the category's id. Ex: [catlist id=24]. You can **include several categories**: Ex: [catlist id=17,24,32] or **exclude** a category with the minus (-)
45
- If you use both arguments (wrong!), List Category Posts will show the posts from the category in 'name'.
 
46
 
47
  * **tags** - Tag support, you can display posts from a certain tag.
48
 
@@ -75,8 +83,6 @@ If you use both arguments (wrong!), List Category Posts will show the posts from
75
 
76
  * **dateformat** - Format of the date output. Default is get_option('date_format'). Check http://codex.wordpress.org/Formatting_Date_and_Time for possible formats.
77
 
78
- * **template** - File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default', which displays an unordered list (ul html tag) with a CSS class. This class can be passed as a parameter or by default it's: 'lcp_catlist'. You can also use the default 'div' value. This will output a div with the 'lcp_catlist' CSS class (or one you pass as parameter with the class argument). The inner items (posts) will be displayed between p tags.
79
-
80
  * **excerpt** - Display the post's excerpt. Default is 'no', use excerpt=yes to activate it.
81
 
82
  * **excludeposts** - IDs of posts to exclude from the list. Ex: [catlist excludeposts=12,52,37]
@@ -103,22 +109,32 @@ If you use both arguments (wrong!), List Category Posts will show the posts from
103
 
104
  * **customfield_display** - Display custom field(s). You can specify many fields to show, separating them with a coma.
105
 
 
 
 
 
 
 
 
 
 
106
 
107
- Your comments and feedback are welcome at:
108
- http://foro.picandocodigo.net/categories/list-category-posts
109
 
110
- **New Code is welcome too** :D
 
111
 
112
  == Frequently Asked Questions ==
113
- * **Instructions** on how to use the plugin: http://foro.picandocodigo.net/discussion/251/list-category-posts-documentation/
114
- * **Template system** how to customize the way the posts are shown: http://foro.picandocodigo.net/discussion/253/list-category-posts-using-templates/. 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.
115
  * **New feature requests** - Contact me on fernando at picandocodigo dot net.
116
  * **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'.
117
 
118
  * **FAQ**
119
 
120
- Plugin could not be activated because it triggered a fatal error.
121
- Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /.../wp-content/plugins/list-category-posts/include/CatListDisplayer.php on line 10
 
122
 
123
  Please check:
124
  http://wordpress.stackexchange.com/questions/9338/list-category-posts-plugin-upgrade-fails-fatal-error/9340#9340
@@ -145,6 +161,10 @@ Template system has changed. Custom templates should be stored in WordPress them
145
 
146
  == Changelog ==
147
 
 
 
 
 
148
  = 0.19.3 =
149
  * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
150
 
4
  Tags: list, categories, posts, cms
5
  Requires at least: 2.8
6
  Tested up to: 3.2.1
7
+ Stable tag: 0.20
8
 
9
  == Description ==
10
  List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
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.
17
 
18
+ Since version 0.18, **this plugins does not work on servers with PHP 4**. If you're still using PHP 4 on your webhost, you should consider upgrading to PHP 5. WordPress 3.1 will be the last version to support PHP 4, from 3.2 and forward, only PHP 5 will be supported. You can still [download an older version of the plugin](https://wordpress.org/extend/plugins/list-category-posts/download/ "download an older version of the plugin") if you're using PHP 4.
19
 
20
  Works correctly with WordPress 3.1 and default Twenty Ten theme
21
  (http://wordpress.org/support/topic/399754)
22
 
23
+ Please, read the information on [Other Notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) and [Changelog](http://wordpress.org/extend/plugins/list-category-posts/changelog/) to be aware of new functionality, and improvements to the plugin.
24
+
25
+ **Usage**
26
+
27
+ `[catlist argument1=value1 argument2=value2]`
28
 
29
  **Support the plugin**
30
 
41
  ==Other notes==
42
 
43
  **Usage**
44
+
45
+ *Selecting the category*
46
+
47
+ The plugin can figure out the category from which you want to list posts in three different ways: Using the *category id*, the *category slug* and *detecting the current post's category*. When using List Category Posts inside a post, if you don't pass the category id or slug, it will detect the category id of the current posts, and list posts from that category. The parameters for the slug and id are:
48
 
49
  * **name** - To display posts from a category using the category's name. Ex: [catlist name=mycategory]
50
 
51
  * **id** - To display posts from a category using the category's id. Ex: [catlist id=24]. You can **include several categories**: Ex: [catlist id=17,24,32] or **exclude** a category with the minus (-)
52
+
53
+ *Other parameters*
54
 
55
  * **tags** - Tag support, you can display posts from a certain tag.
56
 
83
 
84
  * **dateformat** - Format of the date output. Default is get_option('date_format'). Check http://codex.wordpress.org/Formatting_Date_and_Time for possible formats.
85
 
 
 
86
  * **excerpt** - Display the post's excerpt. Default is 'no', use excerpt=yes to activate it.
87
 
88
  * **excludeposts** - IDs of posts to exclude from the list. Ex: [catlist excludeposts=12,52,37]
109
 
110
  * **customfield_display** - Display custom field(s). You can specify many fields to show, separating them with a coma.
111
 
112
+ * **template** - File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default', which displays an unordered list (ul html tag) with a CSS class. This class can be passed as a parameter or by default it's: 'lcp_catlist'. You can also use the default 'div' value. This will output a div with the 'lcp_catlist' CSS class (or one you pass as parameter with the class argument). The inner items (posts) will be displayed between p tags.
113
+
114
+ **Template System**
115
+
116
+ 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.
117
+
118
+ You can use the included template as an example to start. It's in the plugin's template folder under the name default.php. To use a template, use this code:
119
+ [catlist id=1 template=templatename]
120
+ If the template file were templatename.php.
121
 
122
+ You can have as many different templates as you want, and use them in different pages and posts. The template code is pretty well documented, so if you're a bit familiar with HTML and PHP, you'll have no problems creating your own template. I'm planning on reworking the template system in order to have a really user friendly way to create templates.
 
123
 
124
+
125
+ **New Code is always welcome** :D
126
 
127
  == Frequently Asked Questions ==
128
+ * **Instructions** on how to use the plugin: http://wordpress.org/extend/plugins/list-category-posts/other_notes/
129
+ * **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.
130
  * **New feature requests** - Contact me on fernando at picandocodigo dot net.
131
  * **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'.
132
 
133
  * **FAQ**
134
 
135
+ **Plugin could not be activated because it triggered a fatal error.**
136
+
137
+ *Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /.../wp-content/plugins/list-category-posts/include/CatListDisplayer.php on line 10*
138
 
139
  Please check:
140
  http://wordpress.stackexchange.com/questions/9338/list-category-posts-plugin-upgrade-fails-fatal-error/9340#9340
161
 
162
  == Changelog ==
163
 
164
+ = 0.20 =
165
+ * Added the possibility to list posts from the current post's category
166
+ * Some fixes to documentation
167
+
168
  = 0.19.3 =
169
  * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
170