Version Description
Full release notes: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.66 |
Comparing to | |
See all releases |
Code changes from version 0.65 to 0.66
- include/lcp-catlist.php +6 -0
- include/lcp-catlistdisplayer.php +8 -0
- include/lcp-options.php +51 -1
- include/lcp-parameters.php +18 -3
- list-category-posts.php +5 -3
- readme.txt +63 -45
include/lcp-catlist.php
CHANGED
@@ -184,6 +184,7 @@ class CatList{
|
|
184 |
$cat_string .
|
185 |
$this->get_category_count() . '</a>';
|
186 |
}
|
|
|
187 |
array_push($link, $cat_string);
|
188 |
}
|
189 |
return implode(", ", $link);
|
@@ -213,6 +214,11 @@ class CatList{
|
|
213 |
endif;
|
214 |
}
|
215 |
|
|
|
|
|
|
|
|
|
|
|
216 |
public function get_conditional_title(){
|
217 |
if($this->utils->lcp_not_empty('conditional_title') && $this->get_posts_count() > 0):
|
218 |
return trim($this->params['conditional_title']);
|
184 |
$cat_string .
|
185 |
$this->get_category_count() . '</a>';
|
186 |
}
|
187 |
+
|
188 |
array_push($link, $cat_string);
|
189 |
}
|
190 |
return implode(", ", $link);
|
214 |
endif;
|
215 |
}
|
216 |
|
217 |
+
public function get_category_description(){
|
218 |
+
if ($this->utils->lcp_not_empty('category_description') && $this->params['category_description'] == 'yes'){
|
219 |
+
return '<p>' . category_description( $this->lcp_category_id) . '</p>';
|
220 |
+
}
|
221 |
+
}
|
222 |
public function get_conditional_title(){
|
223 |
if($this->utils->lcp_not_empty('conditional_title') && $this->get_posts_count() > 0):
|
224 |
return trim($this->params['conditional_title']);
|
include/lcp-catlistdisplayer.php
CHANGED
@@ -105,6 +105,8 @@ class CatListDisplayer {
|
|
105 |
private function build_output($tag){
|
106 |
$this->category_title();
|
107 |
|
|
|
|
|
108 |
$this->lcp_output .= '<' . $tag;
|
109 |
|
110 |
// Follow the numner of posts in an ordered list with pagination
|
@@ -328,6 +330,12 @@ class CatListDisplayer {
|
|
328 |
endif;
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
/**
|
332 |
* Auxiliary functions for templates
|
333 |
*/
|
105 |
private function build_output($tag){
|
106 |
$this->category_title();
|
107 |
|
108 |
+
$this->get_category_description();
|
109 |
+
|
110 |
$this->lcp_output .= '<' . $tag;
|
111 |
|
112 |
// Follow the numner of posts in an ordered list with pagination
|
330 |
endif;
|
331 |
}
|
332 |
|
333 |
+
public function get_category_description(){
|
334 |
+
if(!empty($this->params['category_description']) && $this->params['category_description'] == 'yes'){
|
335 |
+
$this->lcp_output .= $this->catlist->get_category_description();
|
336 |
+
}
|
337 |
+
}
|
338 |
+
|
339 |
/**
|
340 |
* Auxiliary functions for templates
|
341 |
*/
|
include/lcp-options.php
CHANGED
@@ -7,6 +7,8 @@ if ( is_admin() ){
|
|
7 |
function lcp_settings() { // whitelist options
|
8 |
register_setting( 'list_category_posts_group', 'numberposts' );
|
9 |
register_setting( 'list_category_posts_group', 'lcp_pagination' );
|
|
|
|
|
10 |
}
|
11 |
|
12 |
function list_category_posts_menu() {
|
@@ -56,7 +58,7 @@ function list_category_posts_options() {
|
|
56 |
<tr valign="top">
|
57 |
<th scope="row">
|
58 |
<label for="lcp_pagination">
|
59 |
-
<strong><?php _e("Pagination", "list-category-posts"); ?>
|
60 |
</label>
|
61 |
</th>
|
62 |
<td>
|
@@ -66,6 +68,54 @@ function list_category_posts_options() {
|
|
66 |
</select>
|
67 |
</td>
|
68 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
</tbody>
|
70 |
</table>
|
71 |
<?php submit_button(); ?>
|
7 |
function lcp_settings() { // whitelist options
|
8 |
register_setting( 'list_category_posts_group', 'numberposts' );
|
9 |
register_setting( 'list_category_posts_group', 'lcp_pagination' );
|
10 |
+
register_setting( 'list_category_posts_group', 'lcp_orderby' );
|
11 |
+
register_setting( 'list_category_posts_group', 'lcp_order' );
|
12 |
}
|
13 |
|
14 |
function list_category_posts_menu() {
|
58 |
<tr valign="top">
|
59 |
<th scope="row">
|
60 |
<label for="lcp_pagination">
|
61 |
+
<strong><?php _e("Pagination", "list-category-posts"); ?> </strong>
|
62 |
</label>
|
63 |
</th>
|
64 |
<td>
|
68 |
</select>
|
69 |
</td>
|
70 |
</tr>
|
71 |
+
|
72 |
+
<tr>
|
73 |
+
<th scope="row">
|
74 |
+
<label for="lcp_orderby">
|
75 |
+
<strong><?php _e("Order by", "list-category-posts"); ?></strong>
|
76 |
+
</label>
|
77 |
+
</th>
|
78 |
+
<td>
|
79 |
+
<select id="lcp_orderby" name="lcp_orderby" type="text" >
|
80 |
+
<?php
|
81 |
+
$lcp_orders = array("date" => __("Date", "list-category-posts"),
|
82 |
+
"modified" => __("Modified Date", "list-category-posts"),
|
83 |
+
"title" => __("Post title", "list-category-posts"),
|
84 |
+
"author" => __("Author", "list-category-posts"),
|
85 |
+
"rand" => __("Random", "list-category-posts"));
|
86 |
+
$orderby = get_option('lcp_orderby');
|
87 |
+
foreach ($lcp_orders as $key=>$value){
|
88 |
+
$option = '<option value="' . $key . '" ';
|
89 |
+
if ($orderby == $key){
|
90 |
+
$option .= ' selected = "selected" ';
|
91 |
+
}
|
92 |
+
$option .= '>';
|
93 |
+
echo $option;
|
94 |
+
_e($value, 'list-category-posts');
|
95 |
+
echo '</option>';
|
96 |
+
}
|
97 |
+
?>
|
98 |
+
</select>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
+
|
102 |
+
<th scope="row">
|
103 |
+
<label for="lcp_order">
|
104 |
+
<strong><?php _e("Order", "list-category-posts"); ?></strong>
|
105 |
+
</label>
|
106 |
+
</th>
|
107 |
+
<td>
|
108 |
+
<select id="lcp_order" name="lcp_order" type="text">
|
109 |
+
<?php $order = get_option('lcp_order'); ?>
|
110 |
+
<option value='desc' <?php if($order == 'desc'): echo "selected: selected"; endif;?>>
|
111 |
+
<?php _e("Descending", 'list-category-posts')?>
|
112 |
+
</option>
|
113 |
+
<option value='asc' <?php if($order == 'asc'): echo "selected: selected"; endif; ?>>
|
114 |
+
<?php _e("Ascending", 'list-category-posts')?>
|
115 |
+
</option>
|
116 |
+
</select>
|
117 |
+
</td>
|
118 |
+
|
119 |
</tbody>
|
120 |
</table>
|
121 |
<?php submit_button(); ?>
|
include/lcp-parameters.php
CHANGED
@@ -24,6 +24,17 @@ class LcpParameters{
|
|
24 |
'order' => $params['order'],
|
25 |
'offset' => $params['offset']
|
26 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->utils = new LcpUtils($params);
|
28 |
|
29 |
// Check posts to exclude
|
@@ -79,13 +90,17 @@ class LcpParameters{
|
|
79 |
}
|
80 |
|
81 |
// Custom taxonomy support
|
82 |
-
|
|
|
83 |
$args['tax_query'] = array(array(
|
84 |
'taxonomy' => $params['taxonomy'],
|
85 |
'field' => 'slug',
|
86 |
-
'terms' => explode(",",$params['
|
87 |
));
|
88 |
-
}
|
|
|
|
|
|
|
89 |
$args['tag'] = $params['tags'];
|
90 |
}
|
91 |
|
24 |
'order' => $params['order'],
|
25 |
'offset' => $params['offset']
|
26 |
);
|
27 |
+
|
28 |
+
if( get_option('lcp_orderby') && $params['orderby'] === ''){
|
29 |
+
$orderby = array('orderby' => get_option('lcp_orderby'));
|
30 |
+
$args = array_merge($args, $orderby);
|
31 |
+
}
|
32 |
+
|
33 |
+
if( get_option('lcp_order') && $params['order'] === ''){
|
34 |
+
$order = array('order' => get_option('lcp_order'));
|
35 |
+
$args = array_merge($args, $order);
|
36 |
+
}
|
37 |
+
|
38 |
$this->utils = new LcpUtils($params);
|
39 |
|
40 |
// Check posts to exclude
|
90 |
}
|
91 |
|
92 |
// Custom taxonomy support
|
93 |
+
// Why didn't I document this?!?
|
94 |
+
if ( $this->utils->lcp_not_empty('taxonomy') && $this->utils->lcp_not_empty('terms') ){
|
95 |
$args['tax_query'] = array(array(
|
96 |
'taxonomy' => $params['taxonomy'],
|
97 |
'field' => 'slug',
|
98 |
+
'terms' => explode(",",$params['terms'])
|
99 |
));
|
100 |
+
}
|
101 |
+
|
102 |
+
// Tag support
|
103 |
+
if ( $this->utils->lcp_not_empty('tags') ) {
|
104 |
$args['tag'] = $params['tags'];
|
105 |
}
|
106 |
|
list-category-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 by category in 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, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
|
6 |
-
Version: 0.
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://fernandobriano.com
|
9 |
|
@@ -42,8 +42,8 @@ class ListCategoryPosts{
|
|
42 |
$atts = shortcode_atts(array(
|
43 |
'id' => '0',
|
44 |
'name' => '',
|
45 |
-
'orderby' => '
|
46 |
-
'order' => '
|
47 |
'numberposts' => '',
|
48 |
'date' => 'no',
|
49 |
'date_tag' => '',
|
@@ -109,8 +109,10 @@ class ListCategoryPosts{
|
|
109 |
'customfield_tag' => '',
|
110 |
'customfield_class' => '',
|
111 |
'taxonomy' => '',
|
|
|
112 |
'categorypage' => '',
|
113 |
'category_count' => '',
|
|
|
114 |
'morelink' => '',
|
115 |
'morelink_class' => '',
|
116 |
'morelink_tag' => '',
|
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 by category in 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, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
|
6 |
+
Version: 0.66
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://fernandobriano.com
|
9 |
|
42 |
$atts = shortcode_atts(array(
|
43 |
'id' => '0',
|
44 |
'name' => '',
|
45 |
+
'orderby' => '',
|
46 |
+
'order' => '',
|
47 |
'numberposts' => '',
|
48 |
'date' => 'no',
|
49 |
'date_tag' => '',
|
109 |
'customfield_tag' => '',
|
110 |
'customfield_class' => '',
|
111 |
'taxonomy' => '',
|
112 |
+
'terms' => '',
|
113 |
'categorypage' => '',
|
114 |
'category_count' => '',
|
115 |
+
'category_description' => 'no',
|
116 |
'morelink' => '',
|
117 |
'morelink_class' => '',
|
118 |
'morelink_tag' => '',
|
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: 4.3.1
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -110,6 +110,54 @@ When using List Category Posts whithout a category id, name or slug, it will pos
|
|
110 |
* 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]`.
|
111 |
* **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.
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
==PAGINATION==
|
114 |
|
115 |
To use pagination, you need to set the following parameters in the shortcode:
|
@@ -164,16 +212,6 @@ update the plugin.
|
|
164 |
* **conditional_title_class** - Specify the class used for the conditional
|
165 |
title. Defaults to the empty string (no special class).
|
166 |
|
167 |
-
* **author_posts** - Get posts by author. Use 'user_nicename' (NOT
|
168 |
-
name). Example: `[catlist author_posts="fernando"]`
|
169 |
-
|
170 |
-
* **tags** - Tag support, display posts from a certain tag.
|
171 |
-
|
172 |
-
* **currenttags** - Display posts from the current post's tags (won't
|
173 |
-
work on pages since they have no tags). Pass it the 'yes' string for it to work: `[catlist currenttags="yes"]`
|
174 |
-
|
175 |
-
* **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
|
176 |
-
|
177 |
* **orderby** - To customize the order. Valid values are:
|
178 |
* **author** - Sort by the numeric author IDs.
|
179 |
* **category** - Sort by the numeric category IDs.
|
@@ -197,10 +235,6 @@ update the plugin.
|
|
197 |
* **ASC** - Ascending (lowest to highest).
|
198 |
* **DESC** - Descending (highest to lowest). Ex: `[catlist name=mycategory orderby=title order=asc]`
|
199 |
|
200 |
-
* **starting_with** - Get posts whose title starts with a certain
|
201 |
-
letter. Example: `[catlist starting_with="l"]` will list all posts
|
202 |
-
whose title starts with L. You can use several letters: `[catlist starting_with="m,o,t"]`.
|
203 |
-
|
204 |
* **numberposts** - Number of posts to return. Set to 0 to use the max
|
205 |
number of posts per page. Set to -1 to remove the limit.
|
206 |
Ex: `[catlist name=mycategory numberposts=10]`
|
@@ -211,10 +245,6 @@ update the plugin.
|
|
211 |
don't specify it, nothing will get displayed where the posts
|
212 |
should be.
|
213 |
|
214 |
-
* **monthnum** and **year** - List posts from a certain year or month. You can use these together or independently. Example: `[catlist year=2015]` will list posts from the year 2015. `[catlist monthnum=8]` will list posts published in August of every year. `[catlist year=2012 monthnum=12]` will list posts from December 2012.
|
215 |
-
|
216 |
-
* **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
|
217 |
-
|
218 |
* **date** - Display post's date next to the title. Default is 'no',
|
219 |
use date=yes to activate it. You can set a css class and an html
|
220 |
tag to wrap the date in with `date_class` and `date_tag` (see HTML
|
@@ -255,10 +285,6 @@ update the plugin.
|
|
255 |
`[catlist id=2 title_limit=50]` will show only the first 50
|
256 |
characters of the title and add "…" at the end.
|
257 |
|
258 |
-
* **excludeposts** - IDs of posts to exclude from the list. Use 'this' to exclude the current post. Ex: `[catlist excludeposts=this,12,52,37]`
|
259 |
-
|
260 |
-
* **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.
|
261 |
-
|
262 |
* **content** - **WARNING**: If you want to show the content on your listed posts, you might want to do this from a new [Page Template](http://codex.wordpress.org/Page_Templates) or a [Custom Post Type](http://codex.wordpress.org/Post_Types#Custom_Post_Type_Templates) template. Using this parameter is discouraged, you can have memory issues as well as infinite loop situations when you're displaying a post that's using List Category Posts. You have been warned. Usage:
|
263 |
|
264 |
Show the excerpt or full content of the post. If there's a <!--more--> tag in the post, then it will behave just as WordPress does: only show the content previous to the more tag. Default is 'no'. Ex: `[catlist content=yes]`
|
@@ -267,6 +293,8 @@ Show the full content of the post regardless of whether there is a <!--more--
|
|
267 |
|
268 |
* **catlink** - Show the title of the category with a link to the category. Use the **catlink_string** option to change the link text. Default is 'no'. Ex: `[catlist catlink=yes]`. The way it's programmed, it should only display the title for the first category you chose, and include the posts from all of the categories. I thought of this parameter mostly for using several shortcodes on one page or post, so that each group of posts would have the title of that group's category. If you need to display several titles with posts, you should use one [catlist] shortcode for each category you want to display.
|
269 |
|
|
|
|
|
270 |
* **catname** - Show the title of the category (or categories), works exactly as `catlink`, but it doesn't add a link to the category.
|
271 |
|
272 |
* **category_count** - Shows the posts count in that category, only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]`
|
@@ -279,26 +307,6 @@ Show the full content of the post regardless of whether there is a <!--more--
|
|
279 |
|
280 |
* **thumbnail_class** - Set a CSS class for the thumbnail.
|
281 |
|
282 |
-
* **post_type** - The type of post to show. Available options are: post - Default, page, attachment, any - all post types. You can use several types, example: `[catlist post_type="page,post" numberposts=-1]`
|
283 |
-
|
284 |
-
* **post_status** - use post status, default value is 'publish'. Valid values:
|
285 |
-
* **publish** - a published post or page.
|
286 |
-
* **pending** - post is pending review.
|
287 |
-
* **draft** - a post in draft status.
|
288 |
-
* **auto-draft** - a newly created post, with no content.
|
289 |
-
* **future** - a post to publish in the future.
|
290 |
-
* **private** - not visible to users who are not logged in.
|
291 |
-
* **inherit** - a revision. see get_children.
|
292 |
-
* **trash** - post is in trashbin (available with Version 2.9).
|
293 |
-
* **any** - retrieves any status except those from post types with 'exclude_from_search' set to true.
|
294 |
-
You can use several post statuses. Example: `[catlist post_status="future, publish" excludeposts=this]`
|
295 |
-
|
296 |
-
* **show_protected** - Show posts protected by password. By default
|
297 |
-
they are not displayed. Use: `[catlist show_protected=yes]`
|
298 |
-
|
299 |
-
* **post_parent** - Show only the children of the post with this ID.
|
300 |
-
Default: None.
|
301 |
-
|
302 |
* **post_suffix** - Pass a String to this parameter to display this
|
303 |
String after every post title.
|
304 |
Ex: `[catlist numberposts=-1
|
@@ -314,8 +322,6 @@ Show the full content of the post regardless of whether there is a <!--more--
|
|
314 |
|
315 |
* **class** - CSS class for the default UL generated by the plugin.
|
316 |
|
317 |
-
* **custom fields** - To use custom fields, you must specify two values: customfield_name and customfield_value. Using this only show posts that contain a custom field with this name and value. Both parameters must be defined, or neither will work.
|
318 |
-
|
319 |
* **customfield_display** - Display custom field(s). You can specify
|
320 |
many fields to show, separating them with a coma. If you want to
|
321 |
display just the value and not the name of the custom field, use
|
@@ -476,6 +482,10 @@ For questions either use the [Support forum](http://wordpress.org/support/plugin
|
|
476 |
|
477 |
== Upgrade Notice ==
|
478 |
|
|
|
|
|
|
|
|
|
479 |
= 0.65 =
|
480 |
Full release notes here: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.65
|
481 |
|
@@ -510,6 +520,14 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
510 |
|
511 |
== Changelog ==
|
512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
= 0.65 =
|
514 |
|
515 |
* Adds pagination parameter to the options page.
|
4 |
Tags: list, categories, posts, cms
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 4.3.1
|
7 |
+
Stable tag: 0.66
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
110 |
* 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]`.
|
111 |
* **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.
|
112 |
|
113 |
+
==Other ways of selecting what posts to show==
|
114 |
+
|
115 |
+
* **author_posts** - Get posts by author. Use 'user_nicename' (NOT
|
116 |
+
name). Example: `[catlist author_posts="fernando"]`
|
117 |
+
|
118 |
+
* **tags** - Tag support, display posts from a certain tag. You can use an "OR" relationship `[catlist tags="nintendo,sega"]` or "AND" relationship (posts that belong to all of the listed tags): `[catilst tags="nintendo+sega"]`.
|
119 |
+
|
120 |
+
* **taxonomy** - You can select posts using custom taxonomies. You need to set the taxonomy and the terms: `[catlist taxonomy='person' terms='bob']`.
|
121 |
+
|
122 |
+
* **currenttags** - Display posts from the current post's tags (won't
|
123 |
+
work on pages since they have no tags). Pass it the 'yes' string for it to work: `[catlist currenttags="yes"]`
|
124 |
+
|
125 |
+
* **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
|
126 |
+
|
127 |
+
* **starting_with** - Get posts whose title starts with a certain
|
128 |
+
letter. Example: `[catlist starting_with="l"]` will list all posts
|
129 |
+
whose title starts with L. You can use several letters: `[catlist starting_with="m,o,t"]`.
|
130 |
+
|
131 |
+
* **monthnum** and **year** - List posts from a certain year or month. You can use these together or independently. Example: `[catlist year=2015]` will list posts from the year 2015. `[catlist monthnum=8]` will list posts published in August of every year. `[catlist year=2012 monthnum=12]` will list posts from December 2012.
|
132 |
+
|
133 |
+
* **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
|
134 |
+
|
135 |
+
* **excludeposts** - IDs of posts to exclude from the list. Use 'this' to exclude the current post. Ex: `[catlist excludeposts=this,12,52,37]`
|
136 |
+
|
137 |
+
* **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.
|
138 |
+
|
139 |
+
* **post_type** - The type of post to show. Available options are: post - Default, page, attachment, any - all post types. You can use several types, example: `[catlist post_type="page,post" numberposts=-1]`
|
140 |
+
|
141 |
+
* **post_status** - use post status, default value is 'publish'. Valid values:
|
142 |
+
* **publish** - a published post or page.
|
143 |
+
* **pending** - post is pending review.
|
144 |
+
* **draft** - a post in draft status.
|
145 |
+
* **auto-draft** - a newly created post, with no content.
|
146 |
+
* **future** - a post to publish in the future.
|
147 |
+
* **private** - not visible to users who are not logged in.
|
148 |
+
* **inherit** - a revision. see get_children.
|
149 |
+
* **trash** - post is in trashbin (available with Version 2.9).
|
150 |
+
* **any** - retrieves any status except those from post types with 'exclude_from_search' set to true.
|
151 |
+
You can use several post statuses. Example: `[catlist post_status="future, publish" excludeposts=this]`
|
152 |
+
|
153 |
+
* **show_protected** - Show posts protected by password. By default
|
154 |
+
they are not displayed. Use: `[catlist show_protected=yes]`
|
155 |
+
|
156 |
+
* **post_parent** - Show only the children of the post with this ID.
|
157 |
+
Default: None.
|
158 |
+
|
159 |
+
* **custom fields** - To use custom fields, you must specify two values: customfield_name and customfield_value. Using this only show posts that contain a custom field with this name and value. Both parameters must be defined, or neither will work.
|
160 |
+
|
161 |
==PAGINATION==
|
162 |
|
163 |
To use pagination, you need to set the following parameters in the shortcode:
|
212 |
* **conditional_title_class** - Specify the class used for the conditional
|
213 |
title. Defaults to the empty string (no special class).
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
* **orderby** - To customize the order. Valid values are:
|
216 |
* **author** - Sort by the numeric author IDs.
|
217 |
* **category** - Sort by the numeric category IDs.
|
235 |
* **ASC** - Ascending (lowest to highest).
|
236 |
* **DESC** - Descending (highest to lowest). Ex: `[catlist name=mycategory orderby=title order=asc]`
|
237 |
|
|
|
|
|
|
|
|
|
238 |
* **numberposts** - Number of posts to return. Set to 0 to use the max
|
239 |
number of posts per page. Set to -1 to remove the limit.
|
240 |
Ex: `[catlist name=mycategory numberposts=10]`
|
245 |
don't specify it, nothing will get displayed where the posts
|
246 |
should be.
|
247 |
|
|
|
|
|
|
|
|
|
248 |
* **date** - Display post's date next to the title. Default is 'no',
|
249 |
use date=yes to activate it. You can set a css class and an html
|
250 |
tag to wrap the date in with `date_class` and `date_tag` (see HTML
|
285 |
`[catlist id=2 title_limit=50]` will show only the first 50
|
286 |
characters of the title and add "…" at the end.
|
287 |
|
|
|
|
|
|
|
|
|
288 |
* **content** - **WARNING**: If you want to show the content on your listed posts, you might want to do this from a new [Page Template](http://codex.wordpress.org/Page_Templates) or a [Custom Post Type](http://codex.wordpress.org/Post_Types#Custom_Post_Type_Templates) template. Using this parameter is discouraged, you can have memory issues as well as infinite loop situations when you're displaying a post that's using List Category Posts. You have been warned. Usage:
|
289 |
|
290 |
Show the excerpt or full content of the post. If there's a <!--more--> tag in the post, then it will behave just as WordPress does: only show the content previous to the more tag. Default is 'no'. Ex: `[catlist content=yes]`
|
293 |
|
294 |
* **catlink** - Show the title of the category with a link to the category. Use the **catlink_string** option to change the link text. Default is 'no'. Ex: `[catlist catlink=yes]`. The way it's programmed, it should only display the title for the first category you chose, and include the posts from all of the categories. I thought of this parameter mostly for using several shortcodes on one page or post, so that each group of posts would have the title of that group's category. If you need to display several titles with posts, you should use one [catlist] shortcode for each category you want to display.
|
295 |
|
296 |
+
* **category_description** Show the category description wrapped in a p tag: `[catlist id=1 category_description='yes']`
|
297 |
+
|
298 |
* **catname** - Show the title of the category (or categories), works exactly as `catlink`, but it doesn't add a link to the category.
|
299 |
|
300 |
* **category_count** - Shows the posts count in that category, only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]`
|
307 |
|
308 |
* **thumbnail_class** - Set a CSS class for the thumbnail.
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
* **post_suffix** - Pass a String to this parameter to display this
|
311 |
String after every post title.
|
312 |
Ex: `[catlist numberposts=-1
|
322 |
|
323 |
* **class** - CSS class for the default UL generated by the plugin.
|
324 |
|
|
|
|
|
325 |
* **customfield_display** - Display custom field(s). You can specify
|
326 |
many fields to show, separating them with a coma. If you want to
|
327 |
display just the value and not the name of the custom field, use
|
482 |
|
483 |
== Upgrade Notice ==
|
484 |
|
485 |
+
= 0.66 =
|
486 |
+
Full release notes:
|
487 |
+
https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
|
488 |
+
|
489 |
= 0.65 =
|
490 |
Full release notes here: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.65
|
491 |
|
520 |
|
521 |
== Changelog ==
|
522 |
|
523 |
+
= 0.66 =
|
524 |
+
* Full release notes: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
|
525 |
+
* Orders the README a bit.
|
526 |
+
* Issues with tags when using more than one tag for OR and AND relationships should be fixed.
|
527 |
+
* Documented the use of custom taxonomies. For some reason I never came around to do that. I changed the parameters for taxonomies, it used the 'tags' parameter for 'terms' before, so I added a 'terms' parameter to make this independent from the tags parameter. So now it looks like this: `[catlist taxonomy='person' terms='bob']`. This might break some current uses of taxonomy, but since it was written so long ago and I don't know why it used "tags", I decided to just create the 'terms' parameter. People using the custom taxonomies were people who are looking at the code anyway since I can't find it documented anywhere. Sorry for the inconveniences!
|
528 |
+
* Adds category description parameter.
|
529 |
+
* Adds orderby and order to options page. Removes default values since they're the default anyway.
|
530 |
+
|
531 |
= 0.65 =
|
532 |
|
533 |
* Adds pagination parameter to the options page.
|