List category posts - Version 0.45

Version Description

  • Adds ol default template to template parameter.
    • Improves documentation.
Download this release

Release Info

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

Code changes from version 0.44.1 to 0.45

Files changed (3) hide show
  1. include/CatListDisplayer.php +4 -1
  2. list_cat_posts.php +1 -1
  3. readme.txt +44 -13
include/CatListDisplayer.php CHANGED
@@ -48,6 +48,9 @@ class CatListDisplayer {
48
  case "div":
49
  $this->build_output('div');
50
  break;
 
 
 
51
  default:
52
  $this->build_output('ul');
53
  break;
@@ -82,7 +85,7 @@ class CatListDisplayer {
82
  }
83
 
84
  $this->lcp_output .= '>';
85
- $inner_tag = ($tag == 'ul') ? 'li' : 'p';
86
 
87
  //Posts loop
88
  foreach ($this->catlist->get_categories_posts() as $single) :
48
  case "div":
49
  $this->build_output('div');
50
  break;
51
+ case "ol":
52
+ $this->build_output('ol');
53
+ break;
54
  default:
55
  $this->build_output('ul');
56
  break;
85
  }
86
 
87
  $this->lcp_output .= '>';
88
+ $inner_tag = ($tag == ('ul' || 'ol') ) ? 'li' : 'p';
89
 
90
  //Posts loop
91
  foreach ($this->catlist->get_categories_posts() as $single) :
list_cat_posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
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.44.1
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
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.45
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
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: 3.3
6
  Tested up to: 3.8.1
7
- Stable tag: 0.44.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -74,16 +74,16 @@ The plugin can figure out the category from which you want to list posts in seve
74
  * **id** - To display posts from a category using the category's id. Ex: `[catlist id=24]`.
75
  * The *category name or slug*.
76
  * **name** - To display posts from a category using the category's name or slug. Ex: `[catlist name=mycategory]`
77
- * *Detecting the current post's category*. You can use the *categorypage* parameter to make it detect the category id of the current posts, and list posts from that category.
78
  * **categorypage** - Set it to "yes" if you want to list the posts from the current post's category. `[catlist categorypage="yes"]`
79
 
80
- When using List Category Posts whithout a category id, name or slug, it will post the latest posts from every category.
81
 
82
- ==Using several categories==
83
 
84
- * **include** posts from several categories with **AND** relationship, posts that belong to all of the listed categories (note this does not show posts from any children of these categories): `[catlist id=17+25+2]` - `[catlist name=sega+nintendo]`.
85
- * **include** posts from several categories with **OR** relationship, posts that belong to any of the listed categories: `[catlist id=17,24,32]` - `[catlist name=sega,nintendo]`.
86
- * **exclude** a category with the minus sign (-): `[catlist id=11,-32,16]`, `[catlist id=1+2-3]`. **Important**: When using the *and* relationship, the order must be categories you want to include first, and exclude after. So `[catlist id=1+2-3]` will work, but `[catlist id=1+2-3+4]` won't.
87
 
88
  ==Pagination==
89
 
@@ -128,9 +128,10 @@ update the plugin.
128
  * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
129
  name). Example: `[catlist author_posts="fernando"]`
130
 
131
- * **tags** - Tag support, you can display posts from a certain tag.
132
 
133
- * **currenttags** - Display posts from the current post's tags.
 
134
 
135
  * **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
136
 
@@ -171,9 +172,15 @@ update the plugin.
171
 
172
  * **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
173
 
174
- * **date** - Display post's date next to the title. Default is 'no', use date=yes to activate it.
 
 
 
175
 
176
- * **author** - Display the post's author next to the title. Default is 'no', use author=yes to activate it.
 
 
 
177
 
178
  * **dateformat** - Format of the date output. The default format is the one you've set on your WordPress settings. Example: `[catlist id=42 dateformat="l F dS, Y"]` would display the date as "Monday January 21st, 2013". Check http://codex.wordpress.org/Formatting_Date_and_Time for more options to display date.
179
 
@@ -249,11 +256,31 @@ update the plugin.
249
  Use it to just print the value of the Custom field and not the
250
  name. Example:
251
  `[catlist numberposts=-1 customfield_display="Mood"
252
- customfield_display_name="no"]`
253
  Will print the value of the Custom Field "Mood" but not the text
254
  "Mood: [value]".
255
 
256
- * **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.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
 
258
  * **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"]`
259
 
@@ -402,6 +429,10 @@ Template system has changed. Custom templates should be stored in WordPress them
402
 
403
  == Changelog ==
404
 
 
 
 
 
405
  = 0.44.1 =
406
  * Removes warning when using current tag in pages
407
  * Small fix on Readme
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
+ Stable tag: 0.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
74
  * **id** - To display posts from a category using the category's id. Ex: `[catlist id=24]`.
75
  * The *category name or slug*.
76
  * **name** - To display posts from a category using the category's name or slug. Ex: `[catlist name=mycategory]`
77
+ * *Detecting the current post's category*. You can use the *categorypage* parameter to make it detect the category id of the current post, and list posts from that category.
78
  * **categorypage** - Set it to "yes" if you want to list the posts from the current post's category. `[catlist categorypage="yes"]`
79
 
80
+ When using List Category Posts whithout a category id, name or slug, it will post the latest posts from **every category**.
81
 
82
+ ==Using more than one category==
83
 
84
+ * Posts from several categories with an **AND** relationship, posts that belong to all of the listed categories (note this does not show posts from any children of these categories): `[catlist id=17+25+2]` - `[catlist name=sega+nintendo]`.
85
+ * Posts from several categories with an **OR** relationship, posts that belong to any of the listed categories: `[catlist id=17,24,32]` - `[catlist name=sega,nintendo]`.
86
+ * **Exclude** a category with the minus sign (-): `[catlist id=11,-32,16]`, `[catlist id=1+2-3]`. **Important**: When using the *and* relationship, you should write the categories you want to include first, and then the ones you want to exclude. So `[catlist id=1+2-3]` will work, but `[catlist id=1+2-3+4]` won't.
87
 
88
  ==Pagination==
89
 
128
  * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
129
  name). Example: `[catlist author_posts="fernando"]`
130
 
131
+ * **tags** - Tag support, display posts from a certain tag.
132
 
133
+ * **currenttags** - Display posts from the current post's tags (won't
134
+ work on pages since they have no tags).
135
 
136
  * **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
137
 
172
 
173
  * **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
174
 
175
+ * **date** - Display post's date next to the title. Default is 'no',
176
+ use date=yes to activate it. You can set a css class and an html
177
+ tag to wrap the date in with `date_class` and `date_tag` (see HTML
178
+ & CSS Customization further below).
179
 
180
+ * **author** - Display the post's author next to the title. Default is
181
+ 'no', use author=yes to activate it. You can set a css class and an html
182
+ tag to wrap the author name in with `author_class` and `author_tag` (see HTML
183
+ & CSS Customization further below).
184
 
185
  * **dateformat** - Format of the date output. The default format is the one you've set on your WordPress settings. Example: `[catlist id=42 dateformat="l F dS, Y"]` would display the date as "Monday January 21st, 2013". Check http://codex.wordpress.org/Formatting_Date_and_Time for more options to display date.
186
 
256
  Use it to just print the value of the Custom field and not the
257
  name. Example:
258
  `[catlist numberposts=-1 customfield_display="Mood"
259
+ customfield_display_name="no"]`
260
  Will print the value of the Custom Field "Mood" but not the text
261
  "Mood: [value]".
262
 
263
+ * **template** - By default, posts will be listed in an unordered list
264
+ (ul tag) with the class 'lcp_catlist':
265
+
266
+ `<ul class="lcp_catlist"><li><a href="post1">Post 1</li>...`
267
+
268
+ You can use a different class by using the *class* parameter.
269
+
270
+ You can create your own template file (Check **Template System**
271
+ further down this document) and pass it as a parameter here. The
272
+ parameter is the template name without the extension. For example
273
+ for `mytemplate.php`, the value would be `mytemplate`.
274
+
275
+ You can also pass these two parameters which yield different
276
+ results:
277
+ * `div` - This will output a div with the `lcp_catlist` class
278
+ (or one you pass as a parameter with the `class` argument). The
279
+ posts will be displayed between p tags.
280
+
281
+ * `ol` - This will output an ordered list with the `lcp_catlist`
282
+ css class (or the one you pass as a parameter with the `class`
283
+ argument) and each post will be a list item inside the ordered list.
284
 
285
  * **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"]`
286
 
429
 
430
  == Changelog ==
431
 
432
+ = 0.45 =
433
+ * Adds ol default template to `template` parameter.
434
+ * Improves documentation.
435
+
436
  = 0.44.1 =
437
  * Removes warning when using current tag in pages
438
  * Small fix on Readme