List category posts - Version 0.71

Version Description

  • Added tags_as_class: Use a post's tags as a class for the li that lists the posts. Default is no. Thanks @vacuus on GitHub for this PR!
Download this release

Release Info

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

Code changes from version 0.70 to 0.71

Files changed (3) hide show
  1. include/lcp-catlistdisplayer.php +593 -580
  2. list-category-posts.php +206 -205
  3. readme.txt +1148 -1137
include/lcp-catlistdisplayer.php CHANGED
@@ -1,580 +1,593 @@
1
- <?php
2
- /**
3
- * This is an auxiliary class to help display the info
4
- * on your CatList instance.
5
- * @author fernando@picandocodigo.net
6
- */
7
- require_once 'lcp-catlist.php';
8
-
9
- class CatListDisplayer {
10
- private $catlist;
11
- private $params = array();
12
- private $lcp_output;
13
-
14
- public static function getTemplatePaths(){
15
- $template_path = TEMPLATEPATH . "/list-category-posts/";
16
- $stylesheet_path = STYLESHEETPATH . "/list-category-posts/";
17
- return array($template_path, $stylesheet_path);
18
- }
19
-
20
- public function __construct($atts) {
21
- $this->params = $atts;
22
- $this->catlist = new CatList($atts);
23
- global $post;
24
- $this->parent = $post;
25
- }
26
-
27
- public function display(){
28
- $this->catlist->save_wp_query();
29
- $this->catlist->get_posts();
30
- $this->select_template();
31
- $this->catlist->restore_wp_query();
32
- wp_reset_query();
33
- return $this->lcp_output;
34
- }
35
-
36
- private function select_template(){
37
- // Check if we got a template param:
38
- if (isset($this->params['template']) &&
39
- !empty($this->params['template'])){
40
- // The default values for ul, ol and div:
41
- if (preg_match('/^ul$|^div$|^ol$/i', $this->params['template'], $matches)){
42
- $this->build_output($matches[0]);
43
- } else {
44
- // Else try an actual template from the params
45
- $this->template();
46
- }
47
- } else {
48
- // Default:
49
- $this->build_output('ul');
50
- }
51
- }
52
-
53
- /**
54
- * Template code
55
- */
56
- private function template(){
57
- $tplFileName = null;
58
- $template_param = $this->params['template'];
59
- $templates = array();
60
-
61
- // Get templates paths and add the incoming parameter to search
62
- // for the php file:
63
- if($template_param){
64
- $paths = self::getTemplatePaths();
65
- foreach($paths as $path){
66
- $templates[] = $path . $template_param . '.php';
67
- }
68
- }
69
-
70
- // Check if we can read the template file:
71
- foreach ($templates as $file) :
72
- if ( is_file($file) && is_readable($file) ) :
73
- $tplFileName = $file;
74
- endif;
75
- endforeach;
76
-
77
- if($tplFileName){
78
- require($tplFileName);
79
- } else {
80
- $this->build_output('ul');
81
- }
82
- }
83
-
84
- public static function get_templates($param = null){
85
- $templates = array();
86
- $paths = self::getTemplatePaths();
87
- foreach ($paths as $templatePath){
88
- if (is_dir($templatePath) && scandir($templatePath)){
89
- foreach (scandir($templatePath) as $file){
90
- // Check that the files found are well formed
91
- if ( ($file[0] != '.') && (substr($file, -4) == '.php') &&
92
- is_file($templatePath.$file) && is_readable($templatePath.$file) ){
93
- $templateName = substr($file, 0, strlen($file)-4);
94
- // Add the template only if necessary
95
- if (!in_array($templateName, $templates)){
96
- $templates[] = $templateName;
97
- }
98
- }
99
- }
100
- }
101
- }
102
- return $templates;
103
- }
104
-
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
113
- if( $tag == 'ol' && $this->catlist->get_page() > 1 ){
114
- $start = $this->catlist->get_number_posts() * ($this->catlist->get_page() - 1) + 1;
115
- $this->lcp_output .= ' start="' . $start . '" ';
116
- }
117
- //Give a class to wrapper tag
118
- if (isset($this->params['class'])):
119
- $this->lcp_output .= ' class="' . $this->params['class'] . '"';
120
- endif;
121
-
122
- //Give id to wrapper tag
123
- if (isset($this->params['instance'])){
124
- $this->lcp_output .= ' id="lcp_instance_' . $this->params['instance'] . '"';
125
- }
126
-
127
- $this->lcp_output .= '>';
128
- $inner_tag = ( ($tag == 'ul') || ($tag == 'ol') ) ? 'li' : 'p';
129
-
130
- $this->lcp_output .= $this->get_conditional_title();
131
-
132
- //Posts loop
133
- global $post;
134
- while ( have_posts() ) : the_post();
135
- if ( !post_password_required($post) ||
136
- ( post_password_required($post) && (
137
- isset($this->params['show_protected']) &&
138
- $this->params['show_protected'] == 'yes' ) )):
139
- $this->lcp_output .= $this->lcp_build_post($post, $inner_tag);
140
- endif;
141
- endwhile;
142
-
143
- if ( ($this->catlist->get_posts_count() == 0) &&
144
- ($this->params["no_posts_text"] != '') ) {
145
- $this->lcp_output .= $this->params["no_posts_text"];
146
- }
147
-
148
- //Close wrapper tag
149
- $this->lcp_output .= '</' . $tag . '>';
150
-
151
- // More link
152
- $this->lcp_output .= $this->get_morelink();
153
-
154
- $this->lcp_output .= $this->get_pagination();
155
- }
156
-
157
- public function get_pagination(){
158
- $pag_output = '';
159
- $lcp_pag_param_present = !empty($this->params['pagination']);
160
- if ($lcp_pag_param_present && $this->params['pagination'] == "yes" ||
161
- # Check if the pagination option is set to true, and the param
162
- # is not set to 'no' (since shortcode parameters should
163
- # override general options.
164
- (get_option('lcp_pagination') === 'true' && ($lcp_pag_param_present && $this->params['pagination'] !== 'false'))):
165
- $lcp_paginator = '';
166
- $number_posts = $this->catlist->get_number_posts();
167
- $pages_count = ceil (
168
- $this->catlist->get_posts_count() /
169
- # Avoid dividing by 0 (pointed out by @rhj4)
170
- max( array( 1, $number_posts ) )
171
- );
172
- if ($pages_count > 1){
173
- for($i = 1; $i <= $pages_count; $i++){
174
- $lcp_paginator .= $this->lcp_page_link($i);
175
- }
176
-
177
- $pag_output .= "<ul class='lcp_paginator'>";
178
-
179
- // Add "Previous" link
180
- if ($this->catlist->get_page() > 1){
181
- $pag_output .= $this->lcp_page_link( intval($this->catlist->get_page()) - 1, $this->params['pagination_prev'] );
182
- }
183
-
184
- $pag_output .= $lcp_paginator;
185
-
186
- // Add "Next" link
187
- if ($this->catlist->get_page() < $pages_count){
188
- $pag_output .= $this->lcp_page_link( intval($this->catlist->get_page()) + 1, $this->params['pagination_next']);
189
- }
190
-
191
- $pag_output .= "</ul>";
192
- }
193
- endif;
194
- return $pag_output;
195
- }
196
-
197
- private function lcp_page_link($page, $char = null){
198
- $current_page = $this->catlist->get_page();
199
- $link = '';
200
-
201
- if ($page == $current_page){
202
- $link = "<li class='lcp_currentpage'>$current_page</li>";
203
- } else {
204
- $request_uri = $_SERVER['REQUEST_URI'];
205
- $query = $_SERVER['QUERY_STRING'];
206
- $amp = ( strpos( $request_uri, "?") ) ? "&" : "";
207
- $pattern = "/[&|?]?lcp_page" . preg_quote($this->catlist->get_instance()) . "=([0-9]+)/";
208
- $query = preg_replace($pattern, '', $query);
209
-
210
- $url = strtok($request_uri,'?');
211
- $protocol = "http";
212
- $port = $_SERVER['SERVER_PORT'];
213
- if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $port == 443){
214
- $protocol = "https";
215
- }
216
- $http_host = $_SERVER['HTTP_HOST'];
217
- $page_link = "$protocol://$http_host$url?$query" .
218
- $amp . "lcp_page" . $this->catlist->get_instance() . "=". $page .
219
- "#lcp_instance_" . $this->catlist->get_instance();
220
- $link .= "<li><a href='$page_link' title='$page'>";
221
- ($char != null) ? ($link .= $char) : ($link .= $page);
222
-
223
- $link .= "</a></li>";
224
- }
225
- // WA: Replace '?&' by '?' to avoid potential redirection problems later on
226
- $link = str_replace('?&', '?', $link );
227
- return $link;
228
- }
229
-
230
- /**
231
- * This function should be overriden for template system.
232
- * @param post $single
233
- * @param HTML tag to display $tag
234
- * @return string
235
- */
236
- private function lcp_build_post($single, $tag){
237
- $class ='';
238
- if ( is_object($this->parent) && is_object($single) && $this->parent->ID == $single->ID ){
239
- $class = ' class="current" ';
240
- }
241
- $lcp_display_output = '<'. $tag . $class . '>';
242
-
243
- if ( empty($this->params['no_post_titles']) || !empty($this->params['no_post_titles']) && $this->params['no_post_titles'] !== 'yes' ) {
244
- $lcp_display_output .= $this->get_post_title($single);
245
- }
246
-
247
- // Comments count
248
- $lcp_display_output .= $this->get_stuff_with_tags_and_classes('comments', $single);
249
-
250
- // Date
251
- if (!empty($this->params['date_tag']) || !empty($this->params['date_class'])):
252
- $lcp_display_output .= $this->get_date($single,
253
- $this->params['date_tag'],
254
- $this->params['date_class']);
255
- else:
256
- $lcp_display_output .= $this->get_date($single);
257
- endif;
258
-
259
- // Date Modified
260
- if (!empty($this->params['date_modified_tag']) || !empty($this->params['date_modified_class'])):
261
- $lcp_display_output .= $this->get_modified_date($single,
262
- $this->params['date_modified_tag'],
263
- $this->params['date_modified_class']);
264
- else:
265
- $lcp_display_output .= $this->get_modified_date($single);
266
- endif;
267
-
268
- // Author
269
- $lcp_display_output .= $this->get_stuff_with_tags_and_classes('author', $single);
270
-
271
- // Display ID
272
- if (!empty($this->params['display_id']) && $this->params['display_id'] == 'yes'){
273
- $lcp_display_output .= $single->ID;
274
- }
275
-
276
- // Custom field display
277
- $lcp_display_output .= $this->get_custom_fields($single);
278
-
279
- $lcp_display_output .= $this->get_thumbnail($single);
280
-
281
- $lcp_display_output .= $this->get_stuff_with_tags_and_classes('content', $single);
282
-
283
- if (!empty($this->params['excerpt_tag'])):
284
- if (!empty($this->params['excerpt_class'])):
285
- $lcp_display_output .= $this->get_excerpt($single,
286
- $this->params['excerpt_tag'],
287
- $this->params['excerpt_class']);
288
- else:
289
- $lcp_display_output .= $this->get_excerpt($single, $this->params['excerpt_tag']);
290
- endif;
291
- else:
292
- $lcp_display_output .= $this->get_excerpt($single);
293
- endif;
294
-
295
- $lcp_display_output .= $this->get_posts_morelink($single);
296
-
297
- $lcp_display_output .= '</' . $tag . '>';
298
- return $lcp_display_output;
299
- }
300
-
301
- private function get_stuff_with_tags_and_classes($entity, $single){
302
- $result = '';
303
- $stuffFunction = 'get_' . $entity;
304
- if (!empty($this->params[$entity . '_tag'])):
305
- if (!empty($this->params[$entity . '_class'])):
306
- $result = $this->$stuffFunction($single, $this->params[$entity . '_tag'], $this->params[$entity . '_class']);
307
- else:
308
- $result = $this->$stuffFunction($single, $this->params[$entity . '_tag']);
309
- endif;
310
- else:
311
- $result = $this->$stuffFunction($single);
312
- endif;
313
- return $result;
314
- }
315
-
316
- private function category_title(){
317
- // More link
318
- if (!empty($this->params['catlink_tag'])):
319
- if (!empty($this->params['catlink_class'])):
320
- $this->lcp_output .= $this->get_category_link(
321
- $this->params['catlink_tag'],
322
- $this->params['catlink_class']
323
- );
324
- else:
325
- $this->lcp_output .= $this->get_category_link($this->params['catlink_tag']);
326
- endif;
327
- else:
328
- $this->lcp_output .= $this->get_category_link("strong");
329
- endif;
330
- }
331
-
332
- public function get_category_description(){
333
- if(!empty($this->params['category_description']) && $this->params['category_description'] == 'yes'){
334
- $this->lcp_output .= $this->catlist->get_category_description();
335
- }
336
- }
337
-
338
- /**
339
- * Auxiliary functions for templates
340
- */
341
- private function get_comments($single, $tag = null, $css_class = null){
342
- return $this->content_getter('comments', $single, $tag, $css_class);
343
- }
344
-
345
-
346
- private function get_author($single, $tag = null, $css_class = null){
347
- return $this->content_getter('author', $single, $tag, $css_class);
348
- }
349
-
350
- private function get_content($single, $tag = null, $css_class = null){
351
- return $this->content_getter('content', $single, $tag, $css_class);
352
- }
353
-
354
- private function get_excerpt($single, $tag = null, $css_class = null){
355
- return $this->content_getter('excerpt', $single, $tag, $css_class);
356
- }
357
-
358
- /*
359
- * These used to be separate functions, now starting to get the code
360
- * in the same function for less repetition.
361
- */
362
- private function content_getter($type, $post, $tag = null, $css_class = null) {
363
- $info = '';
364
- switch( $type ){
365
- case 'comments':
366
- $info = $this->catlist->get_comments_count($post);
367
- break;
368
- case 'author':
369
- $info = $this->catlist->get_author_to_show($post);
370
- break;
371
- case 'content':
372
- $info = $this->catlist->get_content($post);
373
- break;
374
- case 'excerpt':
375
- $info = $this->catlist->get_excerpt($post);
376
- $info = preg_replace('/\[.*\]/', '', $info);
377
- }
378
- return $this->assign_style($info, $tag, $css_class);
379
- }
380
-
381
- private function get_conditional_title(){
382
- if(!empty($this->params['conditional_title_tag']))
383
- $tag = $this->params['conditional_title_tag'];
384
- else
385
- $tag = 'h3';
386
- if(!empty($this->params['conditional_title_class']))
387
- $class = $this->params['conditional_title_class'];
388
- else
389
- $class = '';
390
-
391
- return $this->assign_style($this->catlist->get_conditional_title(), $tag, $class);
392
- }
393
-
394
- private function get_custom_fields($single){
395
- if(!empty($this->params['customfield_display'])){
396
- $info = $this->catlist->get_custom_fields($this->params['customfield_display'], $single->ID);
397
- if(empty($this->params['customfield_tag']) || $this->params['customfield_tag'] == null){
398
- $tag = 'div';
399
- } else {
400
- $tag = $this->params['customfield_tag'];
401
- }
402
-
403
- if(empty($this->params['customfield_class']) || $this->params['customfield_class'] == null){
404
- $css_class = 'lcp_customfield';
405
- } else {
406
- $css_class = $this->params['customfield_class'];
407
- }
408
-
409
- $final_info = '';
410
- if(!is_array($info)){
411
- $final_info = $this->assign_style($info, $tag, $css_class);
412
- }else{
413
- if($this->params['customfield_display_separately'] != 'no'){
414
- foreach($info as $i)
415
- $final_info .= $this->assign_style($i, $tag, $css_class);
416
- }else{
417
- $one_info = implode($this->params['customfield_display_glue'], $info);
418
- $final_info = $this->assign_style($one_info, $tag, $css_class);
419
- }
420
- }
421
- return $final_info;
422
- }
423
- }
424
-
425
- private function get_date($single, $tag = null, $css_class = null){
426
- $info = $this->catlist->get_date_to_show($single);
427
-
428
- if ( !empty($this->params['link_dates']) && ( 'yes' === $this->params['link_dates'] || 'true' === $this->params['link_dates'] ) ):
429
- $info = $this->get_post_link($single, $info);
430
- endif;
431
-
432
- $info = ' ' . $info;
433
- return $this->assign_style($info, $tag, $css_class);
434
- }
435
-
436
- private function get_modified_date($single, $tag = null, $css_class = null){
437
- $info = " " . $this->catlist->get_modified_date_to_show($single);
438
- return $this->assign_style($info, $tag, $css_class);
439
- }
440
-
441
- private function get_thumbnail($single, $tag = null){
442
- if ( !empty($this->params['thumbnail_class']) ) :
443
- $lcp_thumb_class = $this->params['thumbnail_class'];
444
- $info = $this->catlist->get_thumbnail($single, $lcp_thumb_class);
445
- else:
446
- $info = $this->catlist->get_thumbnail($single);
447
- endif;
448
-
449
- return $this->assign_style($info, $tag);
450
- }
451
-
452
- private function get_post_link($single, $text, $class = null){
453
- $info = '<a href="' . get_permalink($single->ID) . '" title="' . wptexturize($single->post_title) . '"';
454
-
455
- if ( !empty($this->params['link_target']) ):
456
- $info .= ' target="' . $this->params['link_target'] . '"';
457
- endif;
458
-
459
- if ( !empty($class ) ):
460
- $info .= ' class="' . $class . '"';
461
- endif;
462
-
463
- $info .= '>' . $text . '</a>';
464
-
465
- return $info;
466
- }
467
-
468
- // Link is a parameter here in case you want to use it on a template
469
- // and not show the links for all the shortcodes using this template:
470
- private function get_post_title($single, $tag = null, $css_class = null, $link = true){
471
- $lcp_post_title = apply_filters('the_title', $single->post_title, $single->ID);
472
-
473
- if ( !empty($this->params['title_limit']) && $this->params['title_limit'] !== "0" ):
474
- $title_limit = intval($this->params['title_limit']);
475
- if( function_exists('mb_strlen') && function_exists('mb_substr') ):
476
- if( mb_strlen($lcp_post_title) > $title_limit ):
477
- $lcp_post_title = mb_substr($lcp_post_title, 0, $title_limit) . "&hellip;";
478
- endif;
479
- else:
480
- if( strlen($lcp_post_title) > $title_limit ):
481
- $lcp_post_title = substr($lcp_post_title, 0, $title_limit) . "&hellip;";
482
- endif;
483
- endif;
484
- endif;
485
-
486
- if (!empty($this->params['title_tag'])){
487
- $pre = "<" . $this->params['title_tag'];
488
- if (!empty($this->params['title_class'])){
489
- $pre .= ' class="' . $this->params['title_class'] . '"';
490
- }
491
- $pre .= '>';
492
- $post = "</" . $this->params['title_tag'] . ">";
493
- }else{
494
- $pre = $post = '';
495
- }
496
-
497
- if ( !$link ||
498
- (!empty($this->params['link_titles']) &&
499
- ( $this->params['link_titles'] === "false" || $this->params['link_titles'] === "no" ) ) ) {
500
- return $pre . $lcp_post_title . $post;
501
- }
502
-
503
- $info = $this->get_post_link($single, $lcp_post_title, (!empty($this->params['title_class']) && empty($this->params['title_tag'])) ? $this->params['title_class'] : null);
504
-
505
- if( !empty($this->params['post_suffix']) ):
506
- $info .= " " . $this->params['post_suffix'];
507
- endif;
508
-
509
- $info = $pre . $info . $post;
510
-
511
- if( $tag !== null || $css_class !== null){
512
- $info = $this->assign_style($info, $tag, $css_class);
513
- }
514
-
515
- return $info;
516
- }
517
-
518
- private function get_posts_morelink($single){
519
- if(!empty($this->params['posts_morelink'])){
520
- $href = 'href="' . get_permalink($single->ID) . '"';
521
- $class = "";
522
- if ( !empty($this->params['posts_morelink_class']) ):
523
- $class = 'class="' . $this->params['posts_morelink_class'] . '" ';
524
- endif;
525
- $readmore = $this->params['posts_morelink'];
526
- return ' <a ' . $href . ' ' . $class . ' >' . $readmore . '</a>';
527
- }
528
- }
529
-
530
- private function get_category_link($tag = null, $css_class = null){
531
- $info = $this->catlist->get_category_link();
532
- return $this->assign_style($info, $tag, $css_class);
533
- }
534
-
535
- private function get_morelink(){
536
- $info = $this->catlist->get_morelink();
537
- if ( !empty($this->params['morelink_tag'])){
538
- if( !empty($this->params['morelink_class']) ){
539
- return "<" . $this->params['morelink_tag'] . " class='" .
540
- $this->params['morelink_class'] . "'>" . $info .
541
- "</" . $this->params["morelink_tag"] . ">";
542
- } else {
543
- return "<" . $this->params['morelink_tag'] . ">" .
544
- $info . "</" . $this->params["morelink_tag"] . ">";
545
- }
546
- } else{
547
- if ( !empty($this->params['morelink_class']) ){
548
- return str_replace("<a", "<a class='" . $this->params['morelink_class'] . "' ", $info);
549
- }
550
- }
551
- return $info;
552
- }
553
-
554
- public function get_category_count(){
555
- return $this->catlist->get_category_count();
556
- }
557
-
558
- /**
559
- * Assign style to the info delivered by CatList. Tag is an HTML tag
560
- * which is passed and will sorround the info. Css_class is the css
561
- * class we want to assign to this tag.
562
- * @param string $info
563
- * @param string $tag
564
- * @param string $css_class
565
- * @return string
566
- */
567
- private function assign_style($info, $tag = null, $css_class = null){
568
- if (!empty($info)):
569
- if (empty($tag) && !empty($css_class)):
570
- $tag = "span";
571
- elseif (empty($tag)):
572
- return $info;
573
- elseif (!empty($tag) && empty($css_class)) :
574
- return '<' . $tag . '>' . $info . '</' . $tag . '>';
575
- endif;
576
- $css_class = sanitize_html_class($css_class);
577
- return '<' . $tag . ' class="' . $css_class . '">' . $info . '</' . $tag . '>';
578
- endif;
579
- }
580
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is an auxiliary class to help display the info
4
+ * on your CatList instance.
5
+ * @author fernando@picandocodigo.net
6
+ */
7
+ require_once 'lcp-catlist.php';
8
+
9
+ class CatListDisplayer {
10
+ private $catlist;
11
+ private $params = array();
12
+ private $lcp_output;
13
+
14
+ public static function getTemplatePaths(){
15
+ $template_path = TEMPLATEPATH . "/list-category-posts/";
16
+ $stylesheet_path = STYLESHEETPATH . "/list-category-posts/";
17
+ return array($template_path, $stylesheet_path);
18
+ }
19
+
20
+ public function __construct($atts) {
21
+ $this->params = $atts;
22
+ $this->catlist = new CatList($atts);
23
+ global $post;
24
+ $this->parent = $post;
25
+ }
26
+
27
+ public function display(){
28
+ $this->catlist->save_wp_query();
29
+ $this->catlist->get_posts();
30
+ $this->select_template();
31
+ $this->catlist->restore_wp_query();
32
+ wp_reset_query();
33
+ return $this->lcp_output;
34
+ }
35
+
36
+ private function select_template(){
37
+ // Check if we got a template param:
38
+ if (isset($this->params['template']) &&
39
+ !empty($this->params['template'])){
40
+ // The default values for ul, ol and div:
41
+ if (preg_match('/^ul$|^div$|^ol$/i', $this->params['template'], $matches)){
42
+ $this->build_output($matches[0]);
43
+ } else {
44
+ // Else try an actual template from the params
45
+ $this->template();
46
+ }
47
+ } else {
48
+ // Default:
49
+ $this->build_output('ul');
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Template code
55
+ */
56
+ private function template(){
57
+ $tplFileName = null;
58
+ $template_param = $this->params['template'];
59
+ $templates = array();
60
+
61
+ // Get templates paths and add the incoming parameter to search
62
+ // for the php file:
63
+ if($template_param){
64
+ $paths = self::getTemplatePaths();
65
+ foreach($paths as $path){
66
+ $templates[] = $path . $template_param . '.php';
67
+ }
68
+ }
69
+
70
+ // Check if we can read the template file:
71
+ foreach ($templates as $file) :
72
+ if ( is_file($file) && is_readable($file) ) :
73
+ $tplFileName = $file;
74
+ endif;
75
+ endforeach;
76
+
77
+ if($tplFileName){
78
+ require($tplFileName);
79
+ } else {
80
+ $this->build_output('ul');
81
+ }
82
+ }
83
+
84
+ public static function get_templates($param = null){
85
+ $templates = array();
86
+ $paths = self::getTemplatePaths();
87
+ foreach ($paths as $templatePath){
88
+ if (is_dir($templatePath) && scandir($templatePath)){
89
+ foreach (scandir($templatePath) as $file){
90
+ // Check that the files found are well formed
91
+ if ( ($file[0] != '.') && (substr($file, -4) == '.php') &&
92
+ is_file($templatePath.$file) && is_readable($templatePath.$file) ){
93
+ $templateName = substr($file, 0, strlen($file)-4);
94
+ // Add the template only if necessary
95
+ if (!in_array($templateName, $templates)){
96
+ $templates[] = $templateName;
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ return $templates;
103
+ }
104
+
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
113
+ if( $tag == 'ol' && $this->catlist->get_page() > 1 ){
114
+ $start = $this->catlist->get_number_posts() * ($this->catlist->get_page() - 1) + 1;
115
+ $this->lcp_output .= ' start="' . $start . '" ';
116
+ }
117
+ //Give a class to wrapper tag
118
+ if (isset($this->params['class'])):
119
+ $this->lcp_output .= ' class="' . $this->params['class'] . '"';
120
+ endif;
121
+
122
+ //Give id to wrapper tag
123
+ if (isset($this->params['instance'])){
124
+ $this->lcp_output .= ' id="lcp_instance_' . $this->params['instance'] . '"';
125
+ }
126
+
127
+ $this->lcp_output .= '>';
128
+ $inner_tag = ( ($tag == 'ul') || ($tag == 'ol') ) ? 'li' : 'p';
129
+
130
+ $this->lcp_output .= $this->get_conditional_title();
131
+
132
+ //Posts loop
133
+ global $post;
134
+ while ( have_posts() ) : the_post();
135
+ if ( !post_password_required($post) ||
136
+ ( post_password_required($post) && (
137
+ isset($this->params['show_protected']) &&
138
+ $this->params['show_protected'] == 'yes' ) )):
139
+ $this->lcp_output .= $this->lcp_build_post($post, $inner_tag);
140
+ endif;
141
+ endwhile;
142
+
143
+ if ( ($this->catlist->get_posts_count() == 0) &&
144
+ ($this->params["no_posts_text"] != '') ) {
145
+ $this->lcp_output .= $this->params["no_posts_text"];
146
+ }
147
+
148
+ //Close wrapper tag
149
+ $this->lcp_output .= '</' . $tag . '>';
150
+
151
+ // More link
152
+ $this->lcp_output .= $this->get_morelink();
153
+
154
+ $this->lcp_output .= $this->get_pagination();
155
+ }
156
+
157
+ public function get_pagination(){
158
+ $pag_output = '';
159
+ $lcp_pag_param_present = !empty($this->params['pagination']);
160
+ if ($lcp_pag_param_present && $this->params['pagination'] == "yes" ||
161
+ # Check if the pagination option is set to true, and the param
162
+ # is not set to 'no' (since shortcode parameters should
163
+ # override general options.
164
+ (get_option('lcp_pagination') === 'true' && ($lcp_pag_param_present && $this->params['pagination'] !== 'false'))):
165
+ $lcp_paginator = '';
166
+ $number_posts = $this->catlist->get_number_posts();
167
+ $pages_count = ceil (
168
+ $this->catlist->get_posts_count() /
169
+ # Avoid dividing by 0 (pointed out by @rhj4)
170
+ max( array( 1, $number_posts ) )
171
+ );
172
+ if ($pages_count > 1){
173
+ for($i = 1; $i <= $pages_count; $i++){
174
+ $lcp_paginator .= $this->lcp_page_link($i);
175
+ }
176
+
177
+ $pag_output .= "<ul class='lcp_paginator'>";
178
+
179
+ // Add "Previous" link
180
+ if ($this->catlist->get_page() > 1){
181
+ $pag_output .= $this->lcp_page_link( intval($this->catlist->get_page()) - 1, $this->params['pagination_prev'] );
182
+ }
183
+
184
+ $pag_output .= $lcp_paginator;
185
+
186
+ // Add "Next" link
187
+ if ($this->catlist->get_page() < $pages_count){
188
+ $pag_output .= $this->lcp_page_link( intval($this->catlist->get_page()) + 1, $this->params['pagination_next']);
189
+ }
190
+
191
+ $pag_output .= "</ul>";
192
+ }
193
+ endif;
194
+ return $pag_output;
195
+ }
196
+
197
+ private function lcp_page_link($page, $char = null){
198
+ $current_page = $this->catlist->get_page();
199
+ $link = '';
200
+
201
+ if ($page == $current_page){
202
+ $link = "<li class='lcp_currentpage'>$current_page</li>";
203
+ } else {
204
+ $request_uri = $_SERVER['REQUEST_URI'];
205
+ $query = $_SERVER['QUERY_STRING'];
206
+ $amp = ( strpos( $request_uri, "?") ) ? "&" : "";
207
+ $pattern = "/[&|?]?lcp_page" . preg_quote($this->catlist->get_instance()) . "=([0-9]+)/";
208
+ $query = preg_replace($pattern, '', $query);
209
+
210
+ $url = strtok($request_uri,'?');
211
+ $protocol = "http";
212
+ $port = $_SERVER['SERVER_PORT'];
213
+ if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $port == 443){
214
+ $protocol = "https";
215
+ }
216
+ $http_host = $_SERVER['HTTP_HOST'];
217
+ $page_link = "$protocol://$http_host$url?$query" .
218
+ $amp . "lcp_page" . $this->catlist->get_instance() . "=". $page .
219
+ "#lcp_instance_" . $this->catlist->get_instance();
220
+ $link .= "<li><a href='$page_link' title='$page'>";
221
+ ($char != null) ? ($link .= $char) : ($link .= $page);
222
+
223
+ $link .= "</a></li>";
224
+ }
225
+ // WA: Replace '?&' by '?' to avoid potential redirection problems later on
226
+ $link = str_replace('?&', '?', $link );
227
+ return $link;
228
+ }
229
+
230
+ /**
231
+ * This function should be overriden for template system.
232
+ * @param post $single
233
+ * @param HTML tag to display $tag
234
+ * @return string
235
+ */
236
+ private function lcp_build_post($single, $tag){
237
+ $class ='';
238
+ $tag_css = '';
239
+ if ( is_object($this->parent) && is_object($single) && $this->parent->ID == $single->ID ){
240
+ $class = 'current';
241
+ }
242
+
243
+ if ( $this->params['tags_as_class'] == 'yes' ) {
244
+ $post_tags = wp_get_post_Tags($single->ID);
245
+ if ( !empty($post_tags) ){
246
+ foreach ($post_tags as $post_tag) {
247
+ $class .= " $post_tag->slug ";
248
+ }
249
+ }
250
+ }
251
+ if ( !empty($class) ){
252
+ $tag_css = 'class="' . $class . '"';
253
+ }
254
+ $lcp_display_output = '<'. $tag . ' ' . $tag_css . '>';
255
+
256
+ if ( empty($this->params['no_post_titles']) || !empty($this->params['no_post_titles']) && $this->params['no_post_titles'] !== 'yes' ) {
257
+ $lcp_display_output .= $this->get_post_title($single);
258
+ }
259
+
260
+ // Comments count
261
+ $lcp_display_output .= $this->get_stuff_with_tags_and_classes('comments', $single);
262
+
263
+ // Date
264
+ if (!empty($this->params['date_tag']) || !empty($this->params['date_class'])):
265
+ $lcp_display_output .= $this->get_date($single,
266
+ $this->params['date_tag'],
267
+ $this->params['date_class']);
268
+ else:
269
+ $lcp_display_output .= $this->get_date($single);
270
+ endif;
271
+
272
+ // Date Modified
273
+ if (!empty($this->params['date_modified_tag']) || !empty($this->params['date_modified_class'])):
274
+ $lcp_display_output .= $this->get_modified_date($single,
275
+ $this->params['date_modified_tag'],
276
+ $this->params['date_modified_class']);
277
+ else:
278
+ $lcp_display_output .= $this->get_modified_date($single);
279
+ endif;
280
+
281
+ // Author
282
+ $lcp_display_output .= $this->get_stuff_with_tags_and_classes('author', $single);
283
+
284
+ // Display ID
285
+ if (!empty($this->params['display_id']) && $this->params['display_id'] == 'yes'){
286
+ $lcp_display_output .= $single->ID;
287
+ }
288
+
289
+ // Custom field display
290
+ $lcp_display_output .= $this->get_custom_fields($single);
291
+
292
+ $lcp_display_output .= $this->get_thumbnail($single);
293
+
294
+ $lcp_display_output .= $this->get_stuff_with_tags_and_classes('content', $single);
295
+
296
+ if (!empty($this->params['excerpt_tag'])):
297
+ if (!empty($this->params['excerpt_class'])):
298
+ $lcp_display_output .= $this->get_excerpt($single,
299
+ $this->params['excerpt_tag'],
300
+ $this->params['excerpt_class']);
301
+ else:
302
+ $lcp_display_output .= $this->get_excerpt($single, $this->params['excerpt_tag']);
303
+ endif;
304
+ else:
305
+ $lcp_display_output .= $this->get_excerpt($single);
306
+ endif;
307
+
308
+ $lcp_display_output .= $this->get_posts_morelink($single);
309
+
310
+ $lcp_display_output .= '</' . $tag . '>';
311
+ return $lcp_display_output;
312
+ }
313
+
314
+ private function get_stuff_with_tags_and_classes($entity, $single){
315
+ $result = '';
316
+ $stuffFunction = 'get_' . $entity;
317
+ if (!empty($this->params[$entity . '_tag'])):
318
+ if (!empty($this->params[$entity . '_class'])):
319
+ $result = $this->$stuffFunction($single, $this->params[$entity . '_tag'], $this->params[$entity . '_class']);
320
+ else:
321
+ $result = $this->$stuffFunction($single, $this->params[$entity . '_tag']);
322
+ endif;
323
+ else:
324
+ $result = $this->$stuffFunction($single);
325
+ endif;
326
+ return $result;
327
+ }
328
+
329
+ private function category_title(){
330
+ // More link
331
+ if (!empty($this->params['catlink_tag'])):
332
+ if (!empty($this->params['catlink_class'])):
333
+ $this->lcp_output .= $this->get_category_link(
334
+ $this->params['catlink_tag'],
335
+ $this->params['catlink_class']
336
+ );
337
+ else:
338
+ $this->lcp_output .= $this->get_category_link($this->params['catlink_tag']);
339
+ endif;
340
+ else:
341
+ $this->lcp_output .= $this->get_category_link("strong");
342
+ endif;
343
+ }
344
+
345
+ public function get_category_description(){
346
+ if(!empty($this->params['category_description']) && $this->params['category_description'] == 'yes'){
347
+ $this->lcp_output .= $this->catlist->get_category_description();
348
+ }
349
+ }
350
+
351
+ /**
352
+ * Auxiliary functions for templates
353
+ */
354
+ private function get_comments($single, $tag = null, $css_class = null){
355
+ return $this->content_getter('comments', $single, $tag, $css_class);
356
+ }
357
+
358
+
359
+ private function get_author($single, $tag = null, $css_class = null){
360
+ return $this->content_getter('author', $single, $tag, $css_class);
361
+ }
362
+
363
+ private function get_content($single, $tag = null, $css_class = null){
364
+ return $this->content_getter('content', $single, $tag, $css_class);
365
+ }
366
+
367
+ private function get_excerpt($single, $tag = null, $css_class = null){
368
+ return $this->content_getter('excerpt', $single, $tag, $css_class);
369
+ }
370
+
371
+ /*
372
+ * These used to be separate functions, now starting to get the code
373
+ * in the same function for less repetition.
374
+ */
375
+ private function content_getter($type, $post, $tag = null, $css_class = null) {
376
+ $info = '';
377
+ switch( $type ){
378
+ case 'comments':
379
+ $info = $this->catlist->get_comments_count($post);
380
+ break;
381
+ case 'author':
382
+ $info = $this->catlist->get_author_to_show($post);
383
+ break;
384
+ case 'content':
385
+ $info = $this->catlist->get_content($post);
386
+ break;
387
+ case 'excerpt':
388
+ $info = $this->catlist->get_excerpt($post);
389
+ $info = preg_replace('/\[.*\]/', '', $info);
390
+ }
391
+ return $this->assign_style($info, $tag, $css_class);
392
+ }
393
+
394
+ private function get_conditional_title(){
395
+ if(!empty($this->params['conditional_title_tag']))
396
+ $tag = $this->params['conditional_title_tag'];
397
+ else
398
+ $tag = 'h3';
399
+ if(!empty($this->params['conditional_title_class']))
400
+ $class = $this->params['conditional_title_class'];
401
+ else
402
+ $class = '';
403
+
404
+ return $this->assign_style($this->catlist->get_conditional_title(), $tag, $class);
405
+ }
406
+
407
+ private function get_custom_fields($single){
408
+ if(!empty($this->params['customfield_display'])){
409
+ $info = $this->catlist->get_custom_fields($this->params['customfield_display'], $single->ID);
410
+ if(empty($this->params['customfield_tag']) || $this->params['customfield_tag'] == null){
411
+ $tag = 'div';
412
+ } else {
413
+ $tag = $this->params['customfield_tag'];
414
+ }
415
+
416
+ if(empty($this->params['customfield_class']) || $this->params['customfield_class'] == null){
417
+ $css_class = 'lcp_customfield';
418
+ } else {
419
+ $css_class = $this->params['customfield_class'];
420
+ }
421
+
422
+ $final_info = '';
423
+ if(!is_array($info)){
424
+ $final_info = $this->assign_style($info, $tag, $css_class);
425
+ }else{
426
+ if($this->params['customfield_display_separately'] != 'no'){
427
+ foreach($info as $i)
428
+ $final_info .= $this->assign_style($i, $tag, $css_class);
429
+ }else{
430
+ $one_info = implode($this->params['customfield_display_glue'], $info);
431
+ $final_info = $this->assign_style($one_info, $tag, $css_class);
432
+ }
433
+ }
434
+ return $final_info;
435
+ }
436
+ }
437
+
438
+ private function get_date($single, $tag = null, $css_class = null){
439
+ $info = $this->catlist->get_date_to_show($single);
440
+
441
+ if ( !empty($this->params['link_dates']) && ( 'yes' === $this->params['link_dates'] || 'true' === $this->params['link_dates'] ) ):
442
+ $info = $this->get_post_link($single, $info);
443
+ endif;
444
+
445
+ $info = ' ' . $info;
446
+ return $this->assign_style($info, $tag, $css_class);
447
+ }
448
+
449
+ private function get_modified_date($single, $tag = null, $css_class = null){
450
+ $info = " " . $this->catlist->get_modified_date_to_show($single);
451
+ return $this->assign_style($info, $tag, $css_class);
452
+ }
453
+
454
+ private function get_thumbnail($single, $tag = null){
455
+ if ( !empty($this->params['thumbnail_class']) ) :
456
+ $lcp_thumb_class = $this->params['thumbnail_class'];
457
+ $info = $this->catlist->get_thumbnail($single, $lcp_thumb_class);
458
+ else:
459
+ $info = $this->catlist->get_thumbnail($single);
460
+ endif;
461
+
462
+ return $this->assign_style($info, $tag);
463
+ }
464
+
465
+ private function get_post_link($single, $text, $class = null){
466
+ $info = '<a href="' . get_permalink($single->ID) . '" title="' . wptexturize($single->post_title) . '"';
467
+
468
+ if ( !empty($this->params['link_target']) ):
469
+ $info .= ' target="' . $this->params['link_target'] . '"';
470
+ endif;
471
+
472
+ if ( !empty($class ) ):
473
+ $info .= ' class="' . $class . '"';
474
+ endif;
475
+
476
+ $info .= '>' . $text . '</a>';
477
+
478
+ return $info;
479
+ }
480
+
481
+ // Link is a parameter here in case you want to use it on a template
482
+ // and not show the links for all the shortcodes using this template:
483
+ private function get_post_title($single, $tag = null, $css_class = null, $link = true){
484
+ $lcp_post_title = apply_filters('the_title', $single->post_title, $single->ID);
485
+
486
+ if ( !empty($this->params['title_limit']) && $this->params['title_limit'] !== "0" ):
487
+ $title_limit = intval($this->params['title_limit']);
488
+ if( function_exists('mb_strlen') && function_exists('mb_substr') ):
489
+ if( mb_strlen($lcp_post_title) > $title_limit ):
490
+ $lcp_post_title = mb_substr($lcp_post_title, 0, $title_limit) . "&hellip;";
491
+ endif;
492
+ else:
493
+ if( strlen($lcp_post_title) > $title_limit ):
494
+ $lcp_post_title = substr($lcp_post_title, 0, $title_limit) . "&hellip;";
495
+ endif;
496
+ endif;
497
+ endif;
498
+
499
+ if (!empty($this->params['title_tag'])){
500
+ $pre = "<" . $this->params['title_tag'];
501
+ if (!empty($this->params['title_class'])){
502
+ $pre .= ' class="' . $this->params['title_class'] . '"';
503
+ }
504
+ $pre .= '>';
505
+ $post = "</" . $this->params['title_tag'] . ">";
506
+ }else{
507
+ $pre = $post = '';
508
+ }
509
+
510
+ if ( !$link ||
511
+ (!empty($this->params['link_titles']) &&
512
+ ( $this->params['link_titles'] === "false" || $this->params['link_titles'] === "no" ) ) ) {
513
+ return $pre . $lcp_post_title . $post;
514
+ }
515
+
516
+ $info = $this->get_post_link($single, $lcp_post_title, (!empty($this->params['title_class']) && empty($this->params['title_tag'])) ? $this->params['title_class'] : null);
517
+
518
+ if( !empty($this->params['post_suffix']) ):
519
+ $info .= " " . $this->params['post_suffix'];
520
+ endif;
521
+
522
+ $info = $pre . $info . $post;
523
+
524
+ if( $tag !== null || $css_class !== null){
525
+ $info = $this->assign_style($info, $tag, $css_class);
526
+ }
527
+
528
+ return $info;
529
+ }
530
+
531
+ private function get_posts_morelink($single){
532
+ if(!empty($this->params['posts_morelink'])){
533
+ $href = 'href="' . get_permalink($single->ID) . '"';
534
+ $class = "";
535
+ if ( !empty($this->params['posts_morelink_class']) ):
536
+ $class = 'class="' . $this->params['posts_morelink_class'] . '" ';
537
+ endif;
538
+ $readmore = $this->params['posts_morelink'];
539
+ return ' <a ' . $href . ' ' . $class . ' >' . $readmore . '</a>';
540
+ }
541
+ }
542
+
543
+ private function get_category_link($tag = null, $css_class = null){
544
+ $info = $this->catlist->get_category_link();
545
+ return $this->assign_style($info, $tag, $css_class);
546
+ }
547
+
548
+ private function get_morelink(){
549
+ $info = $this->catlist->get_morelink();
550
+ if ( !empty($this->params['morelink_tag'])){
551
+ if( !empty($this->params['morelink_class']) ){
552
+ return "<" . $this->params['morelink_tag'] . " class='" .
553
+ $this->params['morelink_class'] . "'>" . $info .
554
+ "</" . $this->params["morelink_tag"] . ">";
555
+ } else {
556
+ return "<" . $this->params['morelink_tag'] . ">" .
557
+ $info . "</" . $this->params["morelink_tag"] . ">";
558
+ }
559
+ } else{
560
+ if ( !empty($this->params['morelink_class']) ){
561
+ return str_replace("<a", "<a class='" . $this->params['morelink_class'] . "' ", $info);
562
+ }
563
+ }
564
+ return $info;
565
+ }
566
+
567
+ public function get_category_count(){
568
+ return $this->catlist->get_category_count();
569
+ }
570
+
571
+ /**
572
+ * Assign style to the info delivered by CatList. Tag is an HTML tag
573
+ * which is passed and will sorround the info. Css_class is the css
574
+ * class we want to assign to this tag.
575
+ * @param string $info
576
+ * @param string $tag
577
+ * @param string $css_class
578
+ * @return string
579
+ */
580
+ private function assign_style($info, $tag = null, $css_class = null){
581
+ if (!empty($info)):
582
+ if (empty($tag) && !empty($css_class)):
583
+ $tag = "span";
584
+ elseif (empty($tag)):
585
+ return $info;
586
+ elseif (!empty($tag) && empty($css_class)) :
587
+ return '<' . $tag . '>' . $info . '</' . $tag . '>';
588
+ endif;
589
+ $css_class = sanitize_html_class($css_class);
590
+ return '<' . $tag . ' class="' . $css_class . '">' . $info . '</' . $tag . '>';
591
+ endif;
592
+ }
593
+ }
list-category-posts.php CHANGED
@@ -1,205 +1,206 @@
1
- <?php
2
- /*
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.70
7
- Author: Fernando Briano
8
- Author URI: http://fernandobriano.com
9
-
10
- Text Domain: list-category-posts
11
- Domain Path: /languages/
12
-
13
- Copyright 2008-2016 Fernando Briano (email : fernando@picandocodigo.net)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 3 of the License, or
18
- any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
- */
29
-
30
-
31
- include 'include/lcp-widget.php';
32
- include 'include/lcp-options.php';
33
- require_once 'include/lcp-catlistdisplayer.php';
34
-
35
- class ListCategoryPosts{
36
- /**
37
- * Gets the shortcode parameters and instantiate plugin objects
38
- * @param $atts
39
- * @param $content
40
- */
41
- static function catlist_func($atts, $content = null) {
42
- $atts = shortcode_atts(array(
43
- 'id' => '0',
44
- 'name' => '',
45
- 'orderby' => '',
46
- 'order' => '',
47
- 'numberposts' => '',
48
- 'date' => 'no',
49
- 'date_tag' => '',
50
- 'date_class' =>'',
51
- 'dateformat' => get_option('date_format'),
52
- 'date_modified' => '',
53
- 'date_modified_tag' => '',
54
- 'date_modified_class' => '',
55
- 'author' => 'no',
56
- 'author_posts_link' => 'no',
57
- 'author_tag' =>'',
58
- 'author_class' => '',
59
- 'author_posts' => '',
60
- 'template' => '',
61
- 'excerpt' => 'no',
62
- 'excerpt_size' => '55',
63
- 'excerpt_strip' => 'yes',
64
- 'excerpt_overwrite' => 'no',
65
- 'excerpt_tag' =>'',
66
- 'excerpt_class' =>'',
67
- 'exclude' => '0',
68
- 'excludeposts' => '0',
69
- 'offset' => '0',
70
- 'tags' => '',
71
- 'exclude_tags' => '',
72
- 'currenttags' => '',
73
- 'content' => 'no',
74
- 'content_tag' => '',
75
- 'content_class' => '',
76
- 'display_id' => 'no',
77
- 'catlink' => 'no',
78
- 'catname' => 'no',
79
- 'catlink_string' => '',
80
- 'catlink_tag' =>'',
81
- 'catlink_class' => '',
82
- 'child_categories' => 'yes',
83
- 'comments' => 'no',
84
- 'comments_tag' => '',
85
- 'comments_class' => '',
86
- 'starting_with' => '',
87
- 'thumbnail' => 'no',
88
- 'thumbnail_size' => 'thumbnail',
89
- 'thumbnail_class' => '',
90
- 'force_thumbnail' => '',
91
- 'title_tag' => '',
92
- 'title_class' => '',
93
- 'title_limit' => '0',
94
- 'post_type' => '',
95
- 'post_status' => '',
96
- 'post_parent' => '0',
97
- 'post_suffix' => '',
98
- 'show_protected' => 'no',
99
- 'class' => 'lcp_catlist',
100
- 'conditional_title' => '',
101
- 'conditional_title_tag' => '',
102
- 'conditional_title_class' => '',
103
- 'customfield_name' => '',
104
- 'customfield_value' =>'',
105
- 'customfield_display' =>'',
106
- 'customfield_display_glue' => '',
107
- 'customfield_display_name' =>'',
108
- 'customfield_display_name_glue' => ' : ',
109
- 'customfield_display_separately' => 'no',
110
- 'customfield_orderby' =>'',
111
- 'customfield_tag' => '',
112
- 'customfield_class' => '',
113
- 'taxonomy' => '',
114
- 'terms' => '',
115
- 'categorypage' => '',
116
- 'category_count' => '',
117
- 'category_description' => 'no',
118
- 'morelink' => '',
119
- 'morelink_class' => '',
120
- 'morelink_tag' => '',
121
- 'posts_morelink' => '',
122
- 'posts_morelink_class' => '',
123
- 'year' => '',
124
- 'monthnum' => '',
125
- 'search' => '',
126
- 'link_target' => '',
127
- 'pagination' => 'no',
128
- 'pagination_next' => '>>',
129
- 'pagination_prev' => '<<',
130
- 'no_posts_text' => "",
131
- 'instance' => '0',
132
- 'no_post_titles' => 'no',
133
- 'link_titles' => true,
134
- 'link_dates' => 'no',
135
- 'after' => '',
136
- 'after_year' => '',
137
- 'after_month' => '',
138
- 'after_day' => '',
139
- 'before' => '',
140
- 'before_year' => '',
141
- 'before_month' => '',
142
- 'before_day' => '',
143
- ), $atts);
144
- if($atts['numberposts'] == ''){
145
- $atts['numberposts'] = get_option('numberposts');
146
- }
147
- if($atts['pagination'] == 'yes' ||
148
- (get_option('lcp_pagination') === 'true' &&
149
- $atts['pagination'] !== 'false') ){
150
- lcp_pagination_css();
151
- }
152
- $catlist_displayer = new CatListDisplayer($atts);
153
- return $catlist_displayer->display();
154
- }
155
- }
156
-
157
- add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
158
-
159
- function lpc_meta($links, $file) {
160
- $plugin = plugin_basename(__FILE__);
161
-
162
- if ($file == $plugin):
163
- return array_merge(
164
- $links,
165
- array( sprintf('<a href="http://wordpress.org/extend/plugins/list-category-posts/other_notes/">%s</a>', __('How to use','list-category-posts')) ),
166
- array( sprintf('<a href="http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support">%s</a>', __('Donate','list-category-posts')) ),
167
- array( sprintf('<a href="https://github.com/picandocodigo/List-Category-Posts">%s</a>', __('Fork on Github','list-category-posts')) )
168
- );
169
- endif;
170
-
171
- return $links;
172
- }
173
-
174
- add_filter( 'plugin_row_meta', 'lpc_meta', 10, 2 );
175
-
176
- //adds a default value to numberposts on plugin activation
177
- function set_default_numberposts() {
178
- add_option('numberposts', 10);
179
- }
180
- register_activation_hook( __FILE__, 'set_default_numberposts' );
181
-
182
- function load_i18n(){
183
- load_plugin_textdomain( 'list-category-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
184
- }
185
- add_action( 'plugins_loaded', 'load_i18n' );
186
-
187
- function lcp_pagination_css(){
188
- if ( @file_exists( get_stylesheet_directory() . '/lcp_paginator.css' ) ):
189
- $css_file = get_stylesheet_directory_uri() . '/lcp_paginator.css';
190
- elseif ( @file_exists( get_template_directory() . '/lcp_paginator.css' ) ):
191
- $css_file = get_template_directory_uri() . '/lcp_paginator.css';
192
- else:
193
- $css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css';
194
- endif;
195
-
196
- wp_enqueue_style( 'lcp_paginator', $css_file);
197
- }
198
-
199
- /**
200
- * TO-DO:
201
- - Pagination * DONE - Need to add "page" text
202
- - Add Older Posts at bottom of List Category Post page
203
- - Simpler template system
204
- - Exclude child categories
205
- */
 
1
+ <?php
2
+ /*
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.71
7
+ Author: Fernando Briano
8
+ Author URI: http://fernandobriano.com
9
+
10
+ Text Domain: list-category-posts
11
+ Domain Path: /languages/
12
+
13
+ Copyright 2008-2016 Fernando Briano (email : fernando@picandocodigo.net)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 3 of the License, or
18
+ any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
+ */
29
+
30
+
31
+ include 'include/lcp-widget.php';
32
+ include 'include/lcp-options.php';
33
+ require_once 'include/lcp-catlistdisplayer.php';
34
+
35
+ class ListCategoryPosts{
36
+ /**
37
+ * Gets the shortcode parameters and instantiate plugin objects
38
+ * @param $atts
39
+ * @param $content
40
+ */
41
+ static function catlist_func($atts, $content = null) {
42
+ $atts = shortcode_atts(array(
43
+ 'id' => '0',
44
+ 'name' => '',
45
+ 'orderby' => '',
46
+ 'order' => '',
47
+ 'numberposts' => '',
48
+ 'date' => 'no',
49
+ 'date_tag' => '',
50
+ 'date_class' =>'',
51
+ 'dateformat' => get_option('date_format'),
52
+ 'date_modified' => '',
53
+ 'date_modified_tag' => '',
54
+ 'date_modified_class' => '',
55
+ 'author' => 'no',
56
+ 'author_posts_link' => 'no',
57
+ 'author_tag' =>'',
58
+ 'author_class' => '',
59
+ 'author_posts' => '',
60
+ 'template' => '',
61
+ 'excerpt' => 'no',
62
+ 'excerpt_size' => '55',
63
+ 'excerpt_strip' => 'yes',
64
+ 'excerpt_overwrite' => 'no',
65
+ 'excerpt_tag' =>'',
66
+ 'excerpt_class' =>'',
67
+ 'exclude' => '0',
68
+ 'excludeposts' => '0',
69
+ 'offset' => '0',
70
+ 'tags' => '',
71
+ 'exclude_tags' => '',
72
+ 'currenttags' => '',
73
+ 'content' => 'no',
74
+ 'content_tag' => '',
75
+ 'content_class' => '',
76
+ 'display_id' => 'no',
77
+ 'catlink' => 'no',
78
+ 'catname' => 'no',
79
+ 'catlink_string' => '',
80
+ 'catlink_tag' =>'',
81
+ 'catlink_class' => '',
82
+ 'child_categories' => 'yes',
83
+ 'comments' => 'no',
84
+ 'comments_tag' => '',
85
+ 'comments_class' => '',
86
+ 'starting_with' => '',
87
+ 'thumbnail' => 'no',
88
+ 'thumbnail_size' => 'thumbnail',
89
+ 'thumbnail_class' => '',
90
+ 'force_thumbnail' => '',
91
+ 'title_tag' => '',
92
+ 'title_class' => '',
93
+ 'title_limit' => '0',
94
+ 'post_type' => '',
95
+ 'post_status' => '',
96
+ 'post_parent' => '0',
97
+ 'post_suffix' => '',
98
+ 'show_protected' => 'no',
99
+ 'class' => 'lcp_catlist',
100
+ 'conditional_title' => '',
101
+ 'conditional_title_tag' => '',
102
+ 'conditional_title_class' => '',
103
+ 'customfield_name' => '',
104
+ 'customfield_value' =>'',
105
+ 'customfield_display' =>'',
106
+ 'customfield_display_glue' => '',
107
+ 'customfield_display_name' =>'',
108
+ 'customfield_display_name_glue' => ' : ',
109
+ 'customfield_display_separately' => 'no',
110
+ 'customfield_orderby' =>'',
111
+ 'customfield_tag' => '',
112
+ 'customfield_class' => '',
113
+ 'taxonomy' => '',
114
+ 'terms' => '',
115
+ 'categorypage' => '',
116
+ 'category_count' => '',
117
+ 'category_description' => 'no',
118
+ 'morelink' => '',
119
+ 'morelink_class' => '',
120
+ 'morelink_tag' => '',
121
+ 'posts_morelink' => '',
122
+ 'posts_morelink_class' => '',
123
+ 'year' => '',
124
+ 'monthnum' => '',
125
+ 'search' => '',
126
+ 'link_target' => '',
127
+ 'pagination' => 'no',
128
+ 'pagination_next' => '>>',
129
+ 'pagination_prev' => '<<',
130
+ 'no_posts_text' => "",
131
+ 'instance' => '0',
132
+ 'no_post_titles' => 'no',
133
+ 'link_titles' => true,
134
+ 'link_dates' => 'no',
135
+ 'after' => '',
136
+ 'after_year' => '',
137
+ 'after_month' => '',
138
+ 'after_day' => '',
139
+ 'before' => '',
140
+ 'before_year' => '',
141
+ 'before_month' => '',
142
+ 'before_day' => '',
143
+ 'tags_as_class' => 'no',
144
+ ), $atts);
145
+ if($atts['numberposts'] == ''){
146
+ $atts['numberposts'] = get_option('numberposts');
147
+ }
148
+ if($atts['pagination'] == 'yes' ||
149
+ (get_option('lcp_pagination') === 'true' &&
150
+ $atts['pagination'] !== 'false') ){
151
+ lcp_pagination_css();
152
+ }
153
+ $catlist_displayer = new CatListDisplayer($atts);
154
+ return $catlist_displayer->display();
155
+ }
156
+ }
157
+
158
+ add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
159
+
160
+ function lpc_meta($links, $file) {
161
+ $plugin = plugin_basename(__FILE__);
162
+
163
+ if ($file == $plugin):
164
+ return array_merge(
165
+ $links,
166
+ array( sprintf('<a href="http://wordpress.org/extend/plugins/list-category-posts/other_notes/">%s</a>', __('How to use','list-category-posts')) ),
167
+ array( sprintf('<a href="http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support">%s</a>', __('Donate','list-category-posts')) ),
168
+ array( sprintf('<a href="https://github.com/picandocodigo/List-Category-Posts">%s</a>', __('Fork on Github','list-category-posts')) )
169
+ );
170
+ endif;
171
+
172
+ return $links;
173
+ }
174
+
175
+ add_filter( 'plugin_row_meta', 'lpc_meta', 10, 2 );
176
+
177
+ //adds a default value to numberposts on plugin activation
178
+ function set_default_numberposts() {
179
+ add_option('numberposts', 10);
180
+ }
181
+ register_activation_hook( __FILE__, 'set_default_numberposts' );
182
+
183
+ function load_i18n(){
184
+ load_plugin_textdomain( 'list-category-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
185
+ }
186
+ add_action( 'plugins_loaded', 'load_i18n' );
187
+
188
+ function lcp_pagination_css(){
189
+ if ( @file_exists( get_stylesheet_directory() . '/lcp_paginator.css' ) ):
190
+ $css_file = get_stylesheet_directory_uri() . '/lcp_paginator.css';
191
+ elseif ( @file_exists( get_template_directory() . '/lcp_paginator.css' ) ):
192
+ $css_file = get_template_directory_uri() . '/lcp_paginator.css';
193
+ else:
194
+ $css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css';
195
+ endif;
196
+
197
+ wp_enqueue_style( 'lcp_paginator', $css_file);
198
+ }
199
+
200
+ /**
201
+ * TO-DO:
202
+ - Pagination * DONE - Need to add "page" text
203
+ - Add Older Posts at bottom of List Category Post page
204
+ - Simpler template system
205
+ - Exclude child categories
206
+ */
readme.txt CHANGED
@@ -1,1137 +1,1148 @@
1
- === List category posts ===
2
- 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: 3.3
6
- Tested up to: 4.7
7
- Stable tag: 0.70
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- == Description ==
12
- **This plugin is looking for maintainers!** Please [take a look at
13
- this issue on
14
- GitHub](https://github.com/picandocodigo/List-Category-Posts/issues/134).
15
-
16
- List Category Posts allows you to list posts by category in a post or page using the `[catlist]` shortcode. When you're editing a page or post, directly insert the shortcode in your text and the posts will be listed there. The *basic* usage would be something like this:
17
-
18
- `[catlist id=1]`
19
-
20
- `[catlist name="news"]`
21
-
22
- The shortcode accepts a category name or id, the order in which you
23
- want the posts to display, and the number of posts to display. You can
24
- also display the post author, date, excerpt, custom field values, even
25
- the content! A lot of parameters have been added to customize what to
26
- display and how to show it. Check [the full
27
- documentation](https://github.com/picandocodigo/List-Category-Posts/wiki)
28
- to learn about the different ways to use it.
29
-
30
- The `[catlist]` shortcode can be used as many times as needed with
31
- different arguments on each post/page.
32
- `[catlist id=1 numberposts=10]`
33
-
34
- There's an options page with only one option -for the moment-, new
35
- options will be implemented on demand (as long as they make
36
- sense). Right now the only global option is the `numberposts`
37
- parameter, to define a default number of posts to show for each
38
- instance (you can override this value by using the `numberposts`
39
- parameter in your shortcode).
40
-
41
- **[Read the instructions](https://github.com/picandocodigo/List-Category-Posts/wiki)** to learn which parameters are available and how to use them.
42
-
43
- If you want to **List Categories** instead of posts you can use my other plugin **[List categories](http://wordpress.org/plugins/list-categories/)**.
44
-
45
- You can find **Frequently Asked Questions** [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
46
-
47
- **Customization**
48
-
49
- The different elements to display can be styled with CSS. you can define an HTML tag to wrap the element with, and a CSS class for this tag. Check [the documentation](https://github.com/picandocodigo/List-Category-Posts/wiki) for usage.
50
-
51
- Great to use WordPress as a CMS, and create pages with several categories posts.
52
-
53
- **Widget**
54
-
55
- The plugin includes a widget which works pretty much the same as the
56
- plugin. Just add as many widgets as you want, and select all the
57
- available options from the Appearence > Widgets page. Not all the
58
- functionality in the shortcode has been implemented in the widget
59
- yet. You can use the shortcode for the most flexibility.
60
-
61
- Please, read the information on [the wiki](https://github.com/picandocodigo/List-Category-Posts/wiki)
62
- and
63
- [Changelog](http://wordpress.org/extend/plugins/list-category-posts/changelog/)
64
- to be aware of new functionality, and improvements to the plugin.
65
-
66
- **Videos**
67
-
68
- Some users have made videos on how to use the plugin, (thank you! you people are awesome!). Check them out here:
69
-
70
- * [Manage WordPress Content with List Category Posts Plugin](http://www.youtube.com/watch?v=kBy_qoGKpdo)
71
- * [Build A Start Here Page with List Category Posts](http://www.youtube.com/watch?v=9YJpZfHIwIY)
72
- * [WordPress: How to List Category Posts on a Page](http://www.youtube.com/watch?v=Zfnzk4IWPNA)
73
-
74
- **Support the plugin**
75
-
76
- If you've found the plugin useful, consider making a [donation via PayPal](http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support "Donate via PayPal") or visit my Amazon Wishlist for [books](http://www.amazon.com/gp/registry/wishlist/2HU1JYOF7DX5Q/ref=wl_web "Amazon Wishlist") or [comic books](http://www.amazon.com/registry/wishlist/1LVYAOJAZQOI0/ref=cm_wl_rlist_go_o) :).
77
-
78
- **Development**
79
-
80
- Development is being tracked on [GitHub](https://github.com/picandocodigo/List-Category-Posts). Fork it, code, make a pull request, suggest improvements, etc. over there. I dream of the day all of the WordPress plugins will be hosted on Git :)
81
-
82
-
83
- ==Installation==
84
-
85
- * Upload the `list-category-posts` directory to your wp-content/plugins/ directory.
86
- * Login to your WordPress Admin menu, go to Plugins, and activate it.
87
- * Start using the '[catlist]` shortcode in your posts and/or pages.
88
- * You can find the List Category Posts widget in the Appearence > Widgets section on your WordPress Dashboard.
89
- * If you want to customize the way the plugin displays the information, check [HTML & CSS Customization](https://github.com/picandocodigo/List-Category-Posts/wiki/HTML-&-CSS-Customization) or the [section on Templates](https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System) on the wiki.
90
-
91
- ==Other notes==
92
-
93
- Since the documentation on how to use the plugin has passed wordpress.org's character limit, the text was cut. I've since started using [a wiki](https://github.com/picandocodigo/List-Category-Posts/wiki) for more comfortable reading and maintaining. Please check it out, suggestions are welcome on GitHub issues!
94
-
95
- ==Instructions on how to use the plugin==
96
-
97
- ==SELECTING THE CATEGORY==
98
- The plugin can figure out the category from which you want to list posts in several ways. **You should use only one of these methods** since these are all mutually exclusive, weird results are expected when using more than one:
99
-
100
- * Using the *category id*.
101
- * **id** - To display posts from a category using the category's id. Ex: `[catlist id=24]`.
102
- * The *category name or slug*.
103
- * **name** - To display posts from a category using the category's name or slug. Ex: `[catlist name=mycategory]`
104
- * *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.
105
- * **categorypage** - Set it to "yes" if you want to list the posts from the current post's category. `[catlist categorypage="yes"]`
106
-
107
- When using List Category Posts whithout a category id, name or slug, it will post the latest posts from **every category**.
108
-
109
- ==USING MORE THAN ONE CATEGORY==
110
-
111
- * 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]`.
112
- * 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]`.
113
- * **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.
114
-
115
- ==Other ways of selecting what posts to show==
116
-
117
- * **child_categories** - Exclude/include posts from the child categories. By default they are included. If you have a "Parent Category" and you use: `[catlist name="Parent Category"]`, you'll see posts from it's child categories as if they were posts from the same category. You can use this parameter to exclude these posts: `[catlist name="Parent Category" child_categories=false]`.
118
-
119
- * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
120
- name). Example: `[catlist author_posts="fernando"]`
121
-
122
- * **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"]`.
123
-
124
- * **taxonomy** - You can select posts using custom taxonomies. You need to set the taxonomy and the terms: `[catlist taxonomy='person' terms='bob']`.
125
-
126
- * **currenttags** - Display posts from the current post's tags (won't
127
- work on pages since they have no tags). Pass it the 'yes' string for it to work: `[catlist currenttags="yes"]`
128
-
129
- * **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
130
-
131
- * **starting_with** - Get posts whose title starts with a certain
132
- letter. Example: `[catlist starting_with="l"]` will list all posts
133
- whose title starts with L. You can use several letters: `[catlist starting_with="m,o,t"]`.
134
-
135
- * **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.
136
-
137
- * **date ranges** - You can also use date ranges for listing posts. For example "list every post after March 14th, 2005". The parameters are: ```after, after_year, after_month, after_day, before, before_year, before_month, before_day```. These parameters are used to specify data_query arguments (see: [the codex](https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters)).
138
-
139
- If you want to list all the posts before a given date, say `Jun 17th, 2007` you can use these two options:
140
- `[catlist before_year=2007 before_month=06 before_day=17]`
141
- Or you can use the `before` parameter with a [strtotime()-compatible string](http://php.net/manual/en/datetime.formats.date.php):
142
- `[catlist before='2007/06/17']`
143
-
144
- The same works for posts after a given date, you can use:
145
- `[catlist after_year=2007 after_month=06 after_day=17]`
146
- Or just `after` with a [strtotime()-compatible string](http://php.net/manual/en/datetime.formats.date.php):
147
- `[catlist after='2007/06/17']`
148
-
149
- `after` takes priority over `after_year`, `after_month`, and `after_day`.
150
- `before` takes priority over `before_year`, `before_month`, and `before_day`.
151
-
152
- * **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
153
-
154
- * **excludeposts** - IDs of posts to exclude from the list. Use 'this' to exclude the current post. Ex: `[catlist excludeposts=this,12,52,37]`
155
-
156
- * **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.
157
-
158
- * **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]`
159
-
160
- * **post_status** - use post status, default value is 'publish'. Valid values:
161
- * **publish** - a published post or page.
162
- * **pending** - post is pending review.
163
- * **draft** - a post in draft status.
164
- * **auto-draft** - a newly created post, with no content.
165
- * **future** - a post to publish in the future.
166
- * **private** - not visible to users who are not logged in.
167
- * **inherit** - a revision. see get_children.
168
- * **trash** - post is in trashbin (available with Version 2.9).
169
- * **any** - retrieves any status except those from post types with 'exclude_from_search' set to true.
170
- You can use several post statuses. Example: `[catlist post_status="future, publish" excludeposts=this]`
171
-
172
- * **show_protected** - Show posts protected by password. By default
173
- they are not displayed. Use: `[catlist show_protected=yes]`
174
-
175
- * **post_parent** - Show only the children of the post with this ID.
176
- Default: None.
177
-
178
- * **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.
179
-
180
- ==PAGINATION
181
-
182
- https://github.com/picandocodigo/List-Category-Posts/wiki/Pagination
183
-
184
- ==OTHER PARAMETERS==
185
-
186
- * **conditional_title** - Display a custom title before the posts list.
187
- The title is not displayed if the list is empty. Set to the empty string
188
- (default value) to disable.
189
- Example: `[catlist conditional_title="Other posts"]`.
190
-
191
- * **conditional_title_tag** - Specify the tag used for the conditional title.
192
- Defaults to 'h3'.
193
-
194
- * **conditional_title_class** - Specify the class used for the conditional
195
- title. Defaults to the empty string (no special class).
196
-
197
- * **orderby** - To customize the order. Valid values are:
198
- * **author** - Sort by the numeric author IDs.
199
- * **category** - Sort by the numeric category IDs.
200
- * **content** - Sort by content.
201
- * **date** - Sort by creation date.
202
- * **ID** - Sort by numeric post ID.
203
- * **menu_order** - Sort by the menu order. Only useful with pages.
204
- * **mime_type** - Sort by MIME type. Only useful with attachments.
205
- * **modified** - Sort by last modified date.
206
- * **name** - Sort by stub.
207
- * **parent** - Sort by parent ID.
208
- * **password** - Sort by password.
209
- * **rand** - Randomly sort results.
210
- * **status** - Sort by status.
211
- * **title** - Sort by title.
212
- * **type** - Sort by type. Ex: `[catlist name=mycategory orderby=date]`
213
-
214
- * **customfield_orderby** - You can order the posts by a custom field. For example: `[catlist numberposts=-1 customfield_orderby=Mood order=desc]` will list all the posts with a "Mood" custom field. Remember the default order is descending, more on order:
215
-
216
- * **order** - How to sort **orderby**. Valid values are:
217
- * **ASC** - Ascending (lowest to highest).
218
- * **DESC** - Descending (highest to lowest). Ex: `[catlist name=mycategory orderby=title order=asc]`
219
-
220
- * **numberposts** - Number of posts to return. Set to 0 to use the max
221
- number of posts per page. Set to -1 to remove the limit.
222
- Ex: `[catlist name=mycategory numberposts=10]`
223
- You can set the default number of posts globally on the options
224
- page on your Dashboard in Settings / List Category Posts.
225
-
226
- * **no_posts_text** - Text to display when no posts are found. If you
227
- don't specify it, nothing will get displayed where the posts
228
- should be.
229
-
230
- * **date** - Display post's date next to the title. Default is 'no',
231
- use date=yes to activate it. You can set a css class and an html
232
- tag to wrap the date in with `date_class` and `date_tag` (see HTML
233
- & CSS Customization further below).
234
-
235
- * **date_modified** - Display the date a post was last modified next
236
- to the title. You can set a css class and an html tag to wrap the
237
- date in with `date_modified_class` and `date_modified_tag` (see
238
- HTML & CSS Customization further below).
239
-
240
- * **author** - Display the post's author next to the title. Default is
241
- 'no', use author=yes to activate it. You can set a css class and an html
242
- tag to wrap the author name in with `author_class` and `author_tag` (see HTML
243
- & CSS Customization further below).
244
-
245
- When displaying the post author, you can also display a link to the
246
- author's page. The following parameter **only works if author=yes
247
- is present in the shortcode**:
248
-
249
- * **author_posts_link** - Gets the URL of the author page for the
250
- author. The HTML and CSS customization are the ones applied to `author`.
251
-
252
- * **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.
253
-
254
- * **excerpt** - Display a plain text excerpt of the post. Default is 'no', use `excerpt=yes` or `excerpt=full` to activate it. If you have a separate excerpt in your post, this text will be used. If you don't have an explicit excerpt in your post, the plugin will generate one from the content, striping its images, shortcodes and HTML tags. If you want to overwrite the post's separate excerpt with an automatically generated one (may be useful to allow HTML tags), use `excerpt_overwrite=yes`.
255
-
256
- If you use `excerpt=yes`, the separate excerpt or content will be limited to the number of words set by the *excerpt_size* parameter (55 words by default).
257
-
258
- If you use `excerpt=full` the plugin will act more like Wordpress. If the post has a separate excerpt, it will be used in full. Otherwise if the content has a &lt;!--more--&gt; tag then the excerpt will be the text before this tag, and if there is no &lt;!--more--&gt; tag then the result will be the same as `excerpt=yes`.
259
-
260
- If you want the automatically generated excerpt to respect your theme's allowed HTML tags, you should use `excerpt_strip=no`, otherwise the HTML tags are automatically stripped.
261
-
262
- * **excerpt_size** - Set the number of *words* to display from the excerpt. Default is 55. Eg: `excerpt_size=30`
263
-
264
- * **excerpt_strip** - Set it to `yes` to strip the excerpt's HTML tags. If the excerpt is auto generated by the plugin, the HTML tags will be stripped, and you should use `excerpt_strip=no` to see the excerpt with HTML formatting.
265
-
266
- * **title_limit** - Set the limit of characters for the title. Ex:
267
- `[catlist id=2 title_limit=50]` will show only the first 50
268
- characters of the title and add "…" at the end.
269
-
270
- * **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:
271
-
272
- * `yes` - Show the excerpt or full content of the post. If there's a &lt;!--more--&gt; 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]`
273
-
274
- * `full` - Show the full content of the post regardless of whether there is a &lt;!--more--&gt; tag in the post. Ex: `[catlist content=full]`
275
-
276
- * **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.
277
-
278
- * **category_description** Show the category description wrapped in a p tag: `[catlist id=1 category_description='yes']`
279
-
280
- * **catname** - Show the title of the category (or categories), works exactly as `catlink`, but it doesn't add a link to the category.
281
-
282
- * **category_count** - Shows the posts count in that category, only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]`
283
-
284
- * **comments** - Show comments count for each post. Default is 'no'. Ex: `[catlist comments=yes]`.
285
-
286
- * **thumbnail** - Show post thumbnail (http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/). Default is 'no'. Ex: `[catlist thumbnail=yes]`.
287
-
288
- * **force_thumbnail** - If the previous parameter is set to 'yes', and there's no featured image, setting this to 'yes' or 'true' will make the plugin look for the first image in the post and use it as a thumbnail. Ex: `[catlist thumbnail=yes force_thumbnail=yes]`.
289
-
290
- * **thumbnail_size** - Either a string keyword (thumbnail, medium, large or full) or 2 values representing width and height in pixels. Ex: `[catlist thumbnail_size=32,32]` or `[catlist thumbnail_size=thumbnail]`
291
-
292
- * **thumbnail_class** - Set a CSS class for the thumbnail.
293
-
294
- * **post_suffix** - Pass a String to this parameter to display this
295
- String after every post title.
296
- Ex: `[catlist numberposts=-1
297
- post_suffix="Hello World"]` will create something like:
298
-
299
- ```<ul class="lcp_catlist" id=lcp_instance_0>
300
- <li>
301
- <a href="http://127.0.0.1:8080/wordpress/?p=42" title="WordPress">
302
- WordPress
303
- </a> Hello World </li>```
304
-
305
- * **display_id** - Set it to yes to show the Post's ID next to the post title: `[catlist id=3 display_id=yes]`
306
-
307
- * **class** - CSS class for the default UL generated by the plugin.
308
-
309
- * **customfield_display** - Display custom field(s). You can specify
310
- many fields to show, separating them with a coma. If you want to
311
- display just the value and not the name of the custom field, use
312
- `customfield_display_name` and set it to no.
313
- By default, the custom fields will show inside a div with a
314
- specific class: `<div class="lcp-customfield">`. You can customize
315
- this using the customfield_tag and customfield_class parameters to
316
- set a different tag (instead of the div) and a specific class
317
- (instead of lcp-customfield).
318
-
319
- * **customfield_display_glue** - Specify the text to appear between two custom
320
- fields if displayed together, defaults to the empty string. Not used if
321
- the `customfield_display_separately` parameter is defined.
322
-
323
- * **customfield_display_separately** - Display the custom fields separately.
324
- Each custom field is displayd within its own tag (see `customfield_tag`).
325
- Defaults to 'no', set to 'yes' to enable. Superseeds the
326
- `customfield_display_glue` parameter when enabled.
327
-
328
- * **customfield_display_name** - To use with `customfield_display`.
329
- Use it to just print the value of the Custom field and not the
330
- name. Example:
331
- `[catlist numberposts=-1 customfield_display="Mood"
332
- customfield_display_name="no"]`
333
- Will print the value of the Custom Field "Mood" but not the text
334
- "Mood: [value]".
335
-
336
- * **customfield_display_name_glue** - To use with `customfield_display_name`.
337
- Use it to specify the text between the name and the value, defaults to
338
- ' : '.
339
-
340
- * **template** - By default, posts will be listed in an unordered list
341
- (ul tag) with the class 'lcp_catlist':
342
-
343
- `<ul class="lcp_catlist"><li><a href="post1">Post 1</a></li>...`
344
-
345
- You can use a different class by using the *class* parameter.
346
-
347
- You can create your own template file (Check **Template System**
348
- further down this document) and pass it as a parameter here. The
349
- parameter is the template name without the extension. For example
350
- for `mytemplate.php`, the value would be `mytemplate`.
351
-
352
- You can also pass these two parameters which yield different
353
- results:
354
- * `div` - This will output a div with the `lcp_catlist` class
355
- (or one you pass as a parameter with the `class` argument). The
356
- posts will be displayed between p tags. `[catlist template=div]`
357
-
358
- * `ol` - This will output an ordered list with the `lcp_catlist`
359
- css class (or the one you pass as a parameter with the `class`
360
- argument) and each post will be a list item inside the ordered list. `[catlist template=ol]`.
361
-
362
- * **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"]`
363
-
364
- * **posts_morelink** - Include a "read more" link after each post. It receives a string of characters as a parameter which will be used as the text of the link. Example: `[catlist id=38 posts_morelink="Read more about this post"]`
365
-
366
- * **link_target** - Select the `target` attribute for links to posts (target=_blank, _self, _parent, _top, *framename*). Example: `[catlink id=3 link_target=_blank]` will create: `<a href="http://localhost/wordpress/?p=45" title="Test post" target="_blank">Test post</a>`
367
-
368
- * **no_post_titles** - If set to `yes`, no post titles will be shown. This may make sense together with `content=yes`.
369
-
370
- * **link_titles** - Option to display titles without links. If set to `false`, the post titles won't be linking to the article.
371
-
372
- * **link_dates** - Option to wrap dates with a link to the post. Set to `true` or `yes` to enable, set to `false` or `no` to disable. Defaults to `false`.
373
-
374
- == Widget ==
375
-
376
- The widget is quite simple, and it doesn't implement all of the plugin's functionality. To use a shortcode in a widget add this code to your theme's functions.php file:
377
-
378
- `add_filter('widget_text', 'do_shortcode');`
379
-
380
- Then just add a new text widget to your blog and use the shortcode there as the widget's content.
381
-
382
- == HTML & CSS Customization ==
383
-
384
- https://github.com/picandocodigo/List-Category-Posts/wiki/HTML-&-CSS-Customization
385
-
386
- == Template System ==
387
-
388
- https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System
389
-
390
- == Frequently Asked Questions ==
391
-
392
- **FAQ**
393
-
394
- You can find the Frequently Asked Questions [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
395
-
396
- **INSTRUCTIONS ON HOW TO USE THE PLUGIN**
397
-
398
- https://github.com/picandocodigo/List-Category-Posts/wiki/
399
-
400
- Please read the instructions and the FAQ before opening a new topic in the support forums.
401
-
402
- **TEMPLATE SYSTEM**
403
-
404
- How to customize the way the posts are shown: https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System. I am aware the Template System is not the friendliest right now, I'll work on improving this if I ever get the time to work on it.
405
-
406
- **NEW FEATURE REQUESTS, BUG FIXES, ENHANCEMENTS**
407
-
408
- You can post them on [GitHub Issues](https://github.com/picandocodigo/List-Category-Posts/issues).
409
-
410
- **FURTHER QUESTIONS**
411
-
412
- For questions either use the [Support forum](http://wordpress.org/support/plugin/list-category-posts) or [WordPress Answers](http://wordpress.stackexchange.com/) (just [ask your question](http://wordpress.stackexchange.com/questions/ask?tags=plugin-list-category-posts) using the 'plugin-list-category-post' tag).
413
-
414
- == Upgrade Notice ==
415
-
416
- = 0.66 =
417
- Full release notes:
418
- https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
419
-
420
- = 0.65 =
421
- Full release notes here: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.65
422
-
423
- = 0.37 =
424
-
425
- When using `content=yes`, if the post has a more tag, the plugin will only show the content previous to the more tag and not all the content as it used before (it now supports the more tag the same way as WordPress).
426
-
427
- = 0.34 =
428
- * Now the plugin accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will sorround the element between span tags and the given CSS class. Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) under **HTML & CSS Customization** for more info.
429
- * Fixed bug on `post_status`, it used to show all published posts and if user was logged in, all private ones too. Now you can specify 'private' to just display private posts, and draft, publish, draft, etc (See **post_status** param on the [instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for more info).
430
-
431
- = 0.25 =
432
- * Translation support.
433
-
434
- = 0.18 =
435
- Template system was upgraded with new options. Backwards compatible, but you can better customize the way the post contents are displayed. Check templates/default.php.
436
-
437
- = 0.17 =
438
- Upgrade your templates: Templates system was rewritten, so your current templates will probably not work. Check out the new default.php file on /templates to see the simpler new way to work with templates.
439
-
440
- = 0.13.2 =
441
- Thumbnail parameter 'thumbnails' changed to 'thumbnail.
442
-
443
- = 0.7.2 =
444
- Template system has changed. Now the posts loop must be defined inside the template. Check templates/default.php for an example.
445
-
446
- = 0.8 =
447
- Widget built for WordPress 2.8's Widget API, so you need at least WP 2.8 to use the widget.
448
-
449
- = 0.9 =
450
- Template system has changed. Custom templates should be stored in WordPress theme folder.
451
-
452
- == Changelog ==
453
-
454
- = 0.70 =
455
-
456
- * Fixed [customfield_class and customfield_tag issues](https://github.com/picandocodigo/List-Category-Posts/issues/201). Thanks [vacuus](https://github.com/vacuus)!!
457
- * Tested up to WordPress 4.6.1
458
- * Added date range, thanks again [vacuus](https://github.com/vacuus)!! Check [the docs](https://github.com/picandocodigo/List-Category-Posts/wiki/How-to-select-which-posts-to-show) to read how to use this.
459
-
460
- = 0.69 =
461
-
462
- * Update lcp-widget.php for PHP 7 compatibility. Thanks @kenshin23!
463
-
464
- = 0.68 =
465
-
466
- Thanks @mmatthews1981, @ottadvantage and @mhoeher for their contributions on this version:
467
-
468
- * Adds Alt Tag to thumbnail
469
- * Handle child_categories flag correctly - https://github.com/picandocodigo/List-Category-Posts/pull/185
470
- * Adds a default value to numberposts on plugin activation - https://github.com/picandocodigo/List-Category-Posts/pull/193
471
-
472
-
473
- = 0.67.1 =
474
- * Bugfix release, this should fix the issues with Parent Categories listings.
475
-
476
- = 0.67 =
477
- * Adds custom css class to current page in pagination `lcp_currentpage`.
478
- * Adds child_categories parameter to being able to exclude child categories' posts from a list.
479
- * New feature to look for the first image in a post when requesting a thumbnail and the post has no featured image. Thanks Michael J. Gibbs for writing this code :)
480
-
481
- = 0.66 =
482
- * Full release notes: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
483
- * Orders the README a bit.
484
- * Issues with tags when using more than one tag for OR and AND relationships should be fixed.
485
- * 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!
486
- * Adds category description parameter.
487
- * Adds orderby and order to options page. Removes default values since they're the default anyway.
488
-
489
- = 0.65 =
490
-
491
- * Adds pagination parameter to the options page.
492
- * Changes the loop in the default template.
493
- * Fixes 'morelink_class not working with templates' in the default template.
494
- * Adds link to post wrapper for the post date. If you have a chance, please thank [bibz](https://github.com/bibz) who is doing awesome Pull Requests to this plugin and occasionally helping out on the support forums here too :)
495
-
496
- = 0.64 =
497
-
498
- * Fixes get_current_tags
499
- * Some updates on the documentation
500
- * Introduces a conditional title, only displayed when posts are found, thanks [bibz](https://github.com/bibz) for this Pull Request!
501
- * Introduces `customfield_display_separately`, `customfield_display_glue` and `customfield_display_name_glue` parameters for multiple custom fields handling by bibz. Thanks! :D
502
-
503
- = 0.63.1 =
504
- * Remove renamed file (Damn using subversion), should fix issues updating.
505
-
506
- = 0.63 =
507
-
508
- * Vagrant box and development environment improved by bibz
509
- * Tested with WordPress 4.3, updated Widget constructor because of [PHP 4 deprecation](https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/).
510
-
511
- = 0.62 =
512
-
513
- * Dutch translation by Gerhard Hoogterp, thank you!
514
- * Re-add the loop fixes and fixes function missing from last time by Sophist-UK, thanks!
515
- * Allow to order by the modified date in the widget by bibz, thanks!
516
-
517
- = 0.61 =
518
-
519
- * Adds Portuguese from Portugal (pt_PT) translation, muito obrigado Joaquim Félix!
520
- * Fixes translation paths, [thanks monpelaud](https://wordpress.org/support/topic/error-of-name-on-some-translation-files-1)!.
521
-
522
-
523
- = 0.60.1 =
524
-
525
- * Reverts switching to the loop til we find a way around for using templates.
526
-
527
- = 0.60 =
528
-
529
- * Fixes the loop so that other plugins work as if this was a blog or archive post.
530
- See [issue #156](https://github.com/picandocodigo/List-Category-Posts/issues/156)
531
- on Github. Thanks Sophist-UK for this new version :)
532
-
533
- = 0.59.2 =
534
-
535
- * Tested with WordPress 4.2
536
- * Sophist's fix: Check for multi-byte functions installed and use ascii functions if not.
537
-
538
- = 0.59.1 =
539
-
540
- * Fix some errors
541
-
542
- = 0.59 =
543
-
544
- **Thanks Sophist from UK for this release** :)
545
-
546
- By Sophist:
547
-
548
- * Fix error causing call to undefined method
549
- * Add excerpt=full to allow either full explicit excerpt or use <?--more--> to define where the excerpt ends.
550
- * Fixes link_titles=false creates plain text rather than unlinked formatted text as you might expect.
551
- * Fixes title_limit not working correctly
552
-
553
- Other minor fixes by me.
554
-
555
- = 0.58.1 =
556
- * Fixes an error with pagination links. Accessing $_SERVER filtered not working on some servers, have to investigate further for a future version.
557
- * Addresses warning messages when debug enabled.
558
-
559
- = 0.58 =
560
- * Removes filter interfering with filters set by other plugins. Thanks [zulkamal](https://github.com/zulkamal) for the Pull Request!
561
- * Adds option to display titles without links. Thanks zulkamal for this Pull Request too! :D
562
- * Workaround to prevent '?&' to appear in URLs. Thanks [mhoeher](https://github.com/mhoeher) for the Pull Request!
563
- * General refactors for improving code quality/security.
564
- * Fixed typo in Readme (Thanks Irma!).
565
- * Fixes excluding tags when using category name (should fix other issues with category name too since there was a bug there).
566
-
567
- = 0.57 =
568
- * Add custom image sizes to the list of selectable image sizes in the widget. Thanks [nuss](https://github.com/nuss) for the Pull Request!
569
- * New Attribute 'no_post_titles'. Thanks [thomasWeise](https://github.com/thomasWeise) for the Pull Request!
570
- * Finnish localization. Thanks [Newman101](https://github.com/Newman101) for the Pull Request!
571
-
572
- = 0.56 =
573
- * Adds Indonesian (Bahasa Indonesia) translation. Thanks Dhyayi Warapsari!
574
- * Adds french from France language. Thanks Dorian Herlory!
575
- * Adds content=full parameter to ignore <!--more--> tags when displaying content. Thanks Sophist-UK!
576
- * Fixes excluded_tags parameter
577
-
578
- = 0.55 =
579
- * Ordered lists now follow the posts count when using pagination - https://wordpress.org/support/topic/templateol-resets-count-when-using-pagination
580
- * Fixes issue introduced in 0.54 with undefined indexes - https://wordpress.org/support/topic/problem-continues-with-0542
581
-
582
- = 0.54.2 =
583
- * Fixes call to undefined method lcp_get_current_post_id()
584
-
585
- = 0.54.1 =
586
- * Fixes bug in LcpParameters.
587
-
588
- = 0.54 =
589
- * Adds http/https check for pagination links.
590
- * Fixes `post_status` and `post_type` parameters for using multiple post statuses and types.
591
- * Big refactor: Thumbnail code, parameters moved to new class,
592
- created util class, removed bad and repeated code, moved category
593
- code to new class. Small fixes all around the place. Went from a
594
- very bad 1.77 GPA to 3.23 on CodeClimate.
595
-
596
-
597
- = 0.53 =
598
- * Makes "starting_with" parameter accept several letters, by Diego Sorribas. Thank you!
599
-
600
- = 0.52 =
601
- * Small fix for pagination and query string.
602
- * Fix on multiple categories with AND relationship.
603
- * Fixes options page 404 and saving options.
604
- * Tested with WordPress 4.1.
605
-
606
- = 0.51 =
607
- * Fixes translations, updates Spanish translation. Translators, please update your po and mo files and submit them via pull request on GitHub :)
608
- * Test compatibility with WordPress 4.0
609
- * Adds icon for WordPress 4.0 new plugin interface.
610
- * Fixes posts_morelink and customfields for templates.
611
- * Adds fixes by [htrex](https://github.com/htrex):
612
- * Fix custom template regression
613
- * Fix excluded categories not working in widget
614
-
615
- = 0.50.3 =
616
-
617
- * Addresses some warnings / scandir on Displayer and catname on widget
618
- * Fixes lcp_paginator.css path
619
- * Some small sanitations
620
-
621
- = 0.50.2 =
622
-
623
- * Small fix on templates
624
-
625
- = 0.50.1 =
626
-
627
- * Fixes issue with catlink.
628
- * Fixes issue with templates named "default"
629
-
630
- = 0.50 =
631
-
632
- * Adds Thai translation by [itpcc](https://github.com/itpcc).
633
- * The widget can now select an existing template. Thanks [Borjan Tchakaloff](https://github.com/bibz)!
634
- * Templates code was refactored.
635
-
636
- = 0.49.1 =
637
-
638
- * Makes sure "starting_with" queries are case insesitive.
639
- * Fixes category link on 'catlink' and 'catname' parameters (were showing twice)
640
-
641
- = 0.49 =
642
-
643
- * Adds `author_posts_link`, to show an author's page.
644
- * Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the [forum](http://wordpress.org/support/topic/a-couple-of-suggestions-and-one-teensy-error).
645
- * Small bug fix for getting current category. Used to check against simple string, now checking against i18n'ed one.
646
-
647
- = 0.48 =
648
-
649
- * Bug fixes
650
- * Adds parameter to show modified date of posts. Thanks Eric Sandine for the Pull Request :)
651
-
652
- = 0.47 =
653
-
654
- * Adds Ukranian translation by Michael Yunat [http://getvoip.com](http://getvoip.com/blog)
655
- * Adds `display_id` parameter. Set it to yes to show the Post's ID next to the post title.
656
- * Adds `starting_with` parameter. Gets posts whose title start with a given letter.
657
-
658
-
659
- = 0.46.4 =
660
- * Finally (hopefully) fix the excerpt issues.
661
-
662
- = 0.46.3 =
663
- * Fix something that I broke on previous update for excerpt :S
664
-
665
- = 0.46.2 =
666
- * Some fixes on displaying excerpt.
667
-
668
- = 0.46.1 =
669
- * Fixes quotes bug on title tag.
670
- * Only show ellipsis when title.size > title_limit when using the
671
- title_limit param.
672
-
673
- = 0.46 =
674
- * Adds "the_excerpt" filter to excerpt to improve compatibility with
675
- the [Jetpack](http://wordpress.org/plugins/jetpack/) plugin.
676
- * Add character limit to title
677
- * Removes debug warnings
678
- * Output valid HTML, attribute quotations - thanks Nikolaus Demmel!
679
-
680
- = 0.45 =
681
- * Adds ol default template to `template` parameter.
682
- * Improves documentation.
683
-
684
- = 0.44.1 =
685
- * Removes warning when using current tag in pages
686
- * Small fix on Readme
687
-
688
- = 0.44 =
689
- * Adds the feature to get an author's posts
690
- * Adds show posts from current post's tags.
691
-
692
- = 0.43.1 =
693
- * Show "no posts text" only if it's been set and there are no posts,
694
- otherwise behave like before.
695
-
696
- = 0.43 =
697
- * Removes filters to order by (should fix issues with order)
698
- * Adds `pagination_prev` and `pagination_next` params to customize
699
- the "Previous" and "Next" buttons on pagination navigation.
700
- * Only show pages in pagination when they are > 1
701
- * Adds `no_posts_text` param to display a custom message when no
702
- posts are found
703
- * Fixes "morelink" class parameter (now can be used without
704
- specifying an HTML tag and the class is applied to the a tag).
705
-
706
- = 0.42.3 =
707
- * Adds missing title attribute from thumbnail links.
708
-
709
- = 0.42.2 =
710
- * Fixes pagination numbers
711
- * Removes warning on wp-debug set to true
712
-
713
- = 0.42.1 =
714
- * Fixes some debug warnings (Ruby's nil doesn't apply in the PHP World)
715
-
716
- = 0.42 =
717
- * Fixes excludeposts=this.
718
- * Adds customfield_tag and customfield_class to customize an HTML tag
719
- and CSS class for custom fields.
720
-
721
- = 0.41.2 =
722
- * Small bugfix with customfield_display_name (wasn't working now it
723
- is)
724
-
725
- = 0.41.1 =
726
- * Fixes customfield display name.
727
- * Fixes size in getting thumbnails, now checks for all available
728
- sizes and defaults ("thumbnail", "full", etc.)
729
-
730
- = 0.41.0 =
731
- * Adds options page, to set the default numberposts value globally.
732
- * Adds `customfield_display_name` param.
733
- * Adds pagination to custom template.
734
- * Fixes date display.
735
- * Adds conditions to Vagrantfile to boot faster and not repeat work.
736
- * Fixes exclude posts, broken when migrating from get_posts to
737
- WP_Query.
738
-
739
- = 0.40.1 =
740
-
741
- * Small fix closing quotes on content when using <!--more-->
742
-
743
- = 0.40 =
744
-
745
- * Tested with WordPress 3.8
746
- * Removes unnecessary stuff on wp_enqueue_styles
747
- * Fixes validation when using quotes in title
748
- * Fixes on <!--more--> tag
749
- * Fixes on title HTML tag and CSS class. (*See HTML & CSS
750
- Customization* on [Other Notes](http://wordpress.org/plugins/list-category-posts/other_notes/) to check the expected behaviour)
751
-
752
- = 0.39 =
753
-
754
- * Adds "post suffix" parameter, to add a String after each post
755
- listed. [Source](http://wordpress.org/support/topic/hack-post-title-adding-elements)
756
-
757
- = 0.38 =
758
-
759
- * Adds pagination. Check **Pagination** on [Other
760
- notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/)
761
- to learn how to use it.
762
- * Adds "How to display thumbnails next to title" to the FAQ.
763
- * Adds a Vagrant box for developers to be able to start coding with
764
- no effort :)
765
-
766
- = 0.37 =
767
- * Supports `more` tag. If there's a &lt;!--more--&gt; tag in the post, then it will behave just as WordPress does: only show the content previous to the more tag.
768
- * Fixes YouTube thumbnails: Includes "embed" urls for youtube video
769
- thumbnails, makes correct img tag when using CSS class.
770
-
771
- = 0.36.2 =
772
-
773
- * Fixed category_count for several categories.
774
-
775
- = 0.36.1 =
776
-
777
- * Fixed catlink to display titles for all the categories when using more than one category.
778
-
779
- = 0.36 =
780
-
781
- * Adds option for "target=_blank" for post links.
782
- * Adds option to exclude category when using the *and* relationship: `[catlist id=1+2-3]` will include posts from categories 1 and 2 but not 3.
783
-
784
- = 0.35 =
785
- * Updated Turkish translation, thanks again [Hakan Er](http://hakanertr.wordpress.com/)!
786
- * Adds feature to order by custom field using the `customfield_orderby` parameter.
787
-
788
- = 0.34.1 =
789
- * Bugfix (removed var_dump)
790
-
791
- = 0.34 =
792
- * Now accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will wrap the element between span tags and the given CSS class. Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) under **HTML & CSS Customization** for more info.
793
- * Fixed bug on `post_status`, it used to show all published posts and if user was logged in, all private ones too. Now you can specify 'private' to just display private posts, and draft, publish, draft, etc (See **post_status** param on the [instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for more info).
794
-
795
- = 0.33 =
796
- * Fixes bug with thumbnail size on Widget.
797
- * Adds feature to make widget title a link to the category. Use 'catlink' as the value for the widget's title to make it a link to the category (based on https://github.com/picandocodigo/List-Category-Posts/pull/51/).
798
- * Fixes morelink styiling with CSS class and tag.
799
- * Adds morelink to templates (based on https://github.com/picandocodigo/List-Category-Posts/pull/48/)
800
- * Fixes tag and CSS class for "catlink" too: http://wordpress.org/support/topic/cat_link-tag-does-not-seem-to-be-working
801
-
802
- = 0.32 =
803
- * Add category count parameter to show the number of posts in a category next to its title. Only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]` - http://wordpress.org/support/topic/count-feature
804
-
805
- = 0.31 =
806
- * Pull request from @cfoellmann, adds testing environment and Travis CI integration. Awesomeness.
807
- * When searching for a thumbnail, if there's no thumbnail on the post but there's a YouTube video, display the YouTube video thumbnail. (wordpress.org/support/topic/youtube-thumbnail)
808
-
809
- = 0.30.3 =
810
- * Bugfix release, fixes current category for post/page
811
-
812
- = 0.30.2 =
813
- * Improves 'current category' detection.
814
- * Adds categorypage parameter to widget
815
-
816
- = 0.30.1 =
817
- * **excerpt** - Fixed default excerpt behaviour from previous release. By default it **will** strip html tags as it always did. If you want it not to strip tags, you'll have to use `excerpt_strip=no`. Added a new parameter to have a consistent excerpt. If you want to overwrite WordPress' excerpt when using the plugin and generate one the way the plugin does when there's no excerpt, use `excerpt_overwrite=yes`.
818
-
819
- = 0.30 =
820
- * Adds ability to exclude tags.
821
- * Changes excerpt. Since lot of users have asked for it, I once again modified the way the excerpt is shown. It now respects your theme's allowed HTML tags and doesn't strip them from the excerpt. If you want to strip tags, use `excerpt_strip=yes`.
822
-
823
- = 0.29 =
824
- * Adds turkish translation, thanks [Hakan Er](http://hakanertr.wordpress.com/) for writing this translation! :)
825
- * Adds "AND" relationship to several categories. Thanks to [hvianna](http://wordpress.org/support/profile/hvianna) from the WordPress forums who [implemented this feature](http://wordpress.org/support/topic/list-only-posts-that-belong-to-two-or-more-categories-solution) :D
826
- * More improvements on readme.
827
-
828
- = 0.28 =
829
- * Improvements on readme, faqs.
830
- * New posts_morelink param: adds a 'read more' link to each post.
831
-
832
- = 0.27.1 =
833
-
834
- * Sets minimum version to WordPress 3.3, since wp_trim_words was introduced in that version. Adds workaround for people using WordPress < 3.3.
835
- * Adds Slovak translation by Branco from [WebHostingGeeks.com](http://webhostinggeeks.com/blog/).
836
- * Removes Debug PHP warnings.
837
- * Checkboxes on Widget save state, i18n for widget.
838
- * Adds excerpt size to widget.
839
-
840
- = 0.27 =
841
-
842
- * Fixes to widget.
843
- * Adds year and month parameters to list posts from a certain year and/or month.
844
- * Adds search parameter to display posts that match a search term.
845
-
846
- = 0.26 =
847
-
848
- * Adds i18n, German and Spanish translations. All credit to [cfoellmann](https://github.com/cfoellmann) for implementing this and writing the German translation. Thanks! :)
849
-
850
- = 0.25.1 =
851
-
852
- * Changed excerpt limit, it uses word count, and is working for WordPress' excerpt and auto generated ones.
853
-
854
- = 0.25 =
855
-
856
- * Better excerpt
857
- * Applies title filter, should work with qTranslate
858
- * Adds post status parameter
859
- * Adds meta links to plugin page - most importantly: INSTRUCTIONS (please read them).
860
-
861
- = 0.24 =
862
-
863
- * Fixes "excerpt doesn't strip shortcodes" - https://github.com/picandocodigo/List-Category-Posts/issues/5
864
- * Exclude currently displayed post - [1](http://wordpress.stackexchange.com/questions/44895/exclude-current-page-from-list-of-pages/), [2](https://github.com/picandocodigo/List-Category-Posts/pull/8)
865
- * Add title to category title [1](http://wordpress.stackexchange.com/questions/44467/list-category-plugin-changing-the-links), will be improved.
866
- * Attempting to condition whitespaces to WordPress Coding Standard (emacs php-mode sucks for this...)
867
- * No more git-svn crap, now I'm developing this over at (GitHub)[https://github.com/picandocodigo/List-Category-Posts] and copying it into the WordPress SVN Repo.
868
-
869
- = 0.23.2 =
870
-
871
- * Bugfix release
872
-
873
- = 0.23.1 =
874
-
875
- * Bugfix release
876
-
877
- = 0.23 =
878
-
879
- 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
880
-
881
- * Added excerpt size. You can set how many characters you want the excerpt to display with 'excerpt_size'.
882
- * Fixed HTML tag and CSS class for each element (Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for usage).
883
- * Removed shortcodes from excerpt.
884
-
885
- = 0.22.3 =
886
-
887
- * Fixed thumbnail size parameter, added usage example on README.
888
- * Added space after author and date http://wordpress.org/support/topic/plugin-list-category-posts-space-required-after
889
-
890
- = 0.22.2 =
891
-
892
- * Fixed bug with the categorypage=yes param.
893
- * Tested with WordPress 3.3.
894
-
895
- = 0.22.1 =
896
-
897
- * Fixed accidentally deleted line which made the catlink=yes param not work.
898
-
899
- = 0.22 =
900
-
901
- * 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
902
- * Added *morelink* parameter, check Other notes for usage.
903
-
904
- = 0.21.2 =
905
-
906
- * Removed var_dump... (Sorry about that)
907
-
908
- = 0.21.1 =
909
-
910
- * Small fixes:
911
- * Used "empty()" function for some Strings instead of evaluating isset() and != ''.
912
- * Include parameters on the get_posts args only when they are set (post_parent among others).
913
-
914
- = 0.21 =
915
-
916
- * Added 'thumbnail_class' parameter, so you can set a CSS class to the thumbnail and style it.
917
-
918
- = 0.20.5 =
919
-
920
- * 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.
921
- * Now the name parameter accepts multiple categories too. Just use: `[catlist name=category1,category2]`
922
-
923
- = 0.20.4 =
924
-
925
- * Yet another bugfix, regarding nothing being displayed when using tags.
926
-
927
- = 0.20.3 =
928
-
929
- * Fixed category detection code, which created some messy bugs in some cases
930
-
931
- = 0.20.2 =
932
-
933
- * Minor bugfix release
934
-
935
- = 0.20.1 =
936
-
937
- * Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
938
-
939
- = 0.20 =
940
-
941
- * Added the possibility to list posts from the current post's category
942
- * Some fixes to documentation
943
-
944
- = 0.19.3 =
945
-
946
- * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
947
-
948
- = 0.19.2 =
949
-
950
- * Small fix, missing parameter for taxonomy.
951
-
952
- = 0.19.1 =
953
-
954
- * Added thumbnail to Widget.
955
- * Added thumbnail link to post (http://picod.net/33).
956
-
957
- = 0.19 =
958
-
959
- 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):
960
-
961
- * 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
962
- * Added thumbnail_size parameter.
963
- * Added support for custom taxonomies and also moved to the array call of get_posts. Coded by wsherliker, thanks! http://picod.net/32
964
- * Fixed widget, now it remembers saved options.
965
-
966
- = 0.18.3 =
967
-
968
- * Small excerpt fix, some readme file fixing too.
969
- * Not showing the_content for password protected posts.
970
-
971
- = 0.18.2 =
972
-
973
- * Small fixes. Should work for name parameter in all cases now.
974
-
975
- = 0.18.1 =
976
-
977
- * Added slug and name to the fetching of category id from previous update.
978
-
979
- = 0.18 =
980
-
981
- * Fixed category id bug. Reported and fixed by Eric Celeste - http://eric.clst.org, thanks!
982
- * Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
983
- * Added category link which wasn't working after previous big update.
984
-
985
- = 0.17.1 =
986
-
987
- * Fixed displaying of "Author:" even when not being called.
988
-
989
- = 0.17 =
990
-
991
- * Major rewrite. The whole code was rewritten using objects. It's easier now to develop for List Category Posts.
992
- * Both STYLESHEETPATH and TEMPLATEPATH are checked for templates.
993
-
994
- = 0.16.1 =
995
-
996
- * Fixed shortcode nesting.
997
-
998
- = 0.16 =
999
-
1000
- * Changed STYLESHEETPATH to TEMPLATEPATH to point to the parent theme.
1001
- * Added support to display custom fields. (http://picod.net/wp03)
1002
- * Tested with WordPress 3.1 - http://wordpress.org/support/topic/399754
1003
-
1004
-
1005
- = 0.15.1 =
1006
-
1007
- * Fixed a bug with undeclared variable. (Check http://picod.net/walcp, thanks Das!)
1008
-
1009
- = 0.15 =
1010
-
1011
- * Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
1012
-
1013
- = 0.14.1 =
1014
-
1015
- * 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.
1016
-
1017
- = 0.14 =
1018
-
1019
- * Added "post_type" and "post_parent" from the underlining "get_posts()" API to be usable within the short-code. By Martin Crawford, thanks!
1020
- * 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).
1021
- * Fixed "tags" parameter on the documentation, it used to say "tag", and the plugin looks for "tags".
1022
-
1023
- = 0.13.2 =
1024
-
1025
- * Fixed thumbnail code, added it to default.php template as example.
1026
-
1027
- = 0.13.1 =
1028
-
1029
- * Fixed broken dateformat.
1030
-
1031
- = 0.13 =
1032
-
1033
- * Show post thumbnails, should be tested, feedback on styling is welcome. Thanks to Sebastian from http://www.avantix.com.ar/
1034
-
1035
- = 0.12 =
1036
-
1037
- * Added comments count.
1038
- * Updated readme file
1039
-
1040
- = 0.11.2 =
1041
-
1042
- * Another minimal bug fixed with the excerpt...
1043
-
1044
- = 0.11.1 =
1045
-
1046
- * Fixed small bug which made the excerpt show up everytime... (Sorry :S)
1047
-
1048
- = 0.11 =
1049
-
1050
- * Automatic excerpt added in case the user didn't specifically write an excerpt.
1051
- * Widget has been finally fixed. The attributes finally save themselves, and the widget works as expected :D
1052
-
1053
-
1054
- = 0.10.1 =
1055
- * Small fix -
1056
- added ul tags to default template.
1057
- * Compatible WordPress 3.0 with Twenty Ten theme (thanks again Doug Joseph :) )
1058
-
1059
- = 0.10 =
1060
-
1061
- * Code for the_content was fixed so that the content to output filtered content (thanks DougJoseph http://wordpress.org/support/topic/399754)
1062
-
1063
- = 0.9 =
1064
-
1065
- * admin parameter now shows "display name" instead of "user nice name".
1066
- * 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)
1067
- * Added tag support
1068
-
1069
- = 0.8.1 =
1070
-
1071
- * Fixed bug for 'content'.
1072
- * There's new stuff on the widget options. I'm still working on it, so some bugs may appear.
1073
-
1074
- = 0.8 =
1075
-
1076
- * 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.
1077
- * Updated readme file.
1078
-
1079
- = 0.7.2 =
1080
-
1081
- * Fixed link to category.
1082
- * Improved template system.
1083
-
1084
- = 0.7.1 =
1085
-
1086
- * Fixed uber stupid bug with offset... Sorry about that!
1087
-
1088
- = 0.7 =
1089
-
1090
- * Exclude posts. Contribution by acub.
1091
- * Offset parameter on shortcode to start listing posts with an offset. Contribution by Levi Vasquez
1092
- * Content of the post can now be displayed. Contribution by Lang Zerner.
1093
- * Link to the category available. By request on the plugin's forum.
1094
- * Fixed small bug when using category name.
1095
-
1096
- = 0.6 =
1097
-
1098
- * Minor fix for unclosed ul if not using templates.
1099
- * Added option to list posts from many categories at once.
1100
- * Added option to exclude categories.
1101
-
1102
- = 0.5 =
1103
-
1104
- * Readme.txt validation.
1105
- * Added 'excerpt' parameter. You can now show the excerpt for each post.
1106
- * Added 'dateformat' parameter. Format of the date output. Default is get_option('date_format') - by Verex
1107
- * Added 'template' parameter. Now you can choose template for output of the plugin. File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default' that means template in code of plugin not in template file -by Verex
1108
-
1109
- = 0.4.1 =
1110
-
1111
- * Fixed some code to enable PHP 4 compatibility. Shouldn't hosting services update to PHP 5?
1112
-
1113
- = 0.4 =
1114
-
1115
- * Added 'date' parameter. Now you can show the post's date when listed.
1116
- * Added 'author' parameter. You can also show the post's author.
1117
- * Sidebar Widget now allows you to add a title in h2 tags.
1118
- * Changed some variable names, to keep better compatibility with other plugins/wordpress variables.
1119
- * Tested with Wordpress 2.7.
1120
-
1121
- = 0.3 =
1122
-
1123
- * Broke backwards compatibility. Users of version 0.1 should update their pages and posts for the new shortcode formatting.
1124
- * Option to pass arguments to the plugin, in order to use name of category instead of ID, orderby, order and number of posts are passed through parameters.
1125
-
1126
- = 0.2 =
1127
-
1128
- * Added experimental sidebar widget (use at your own risk, not ready for prime-time yet since it hasn't been tested :P )
1129
-
1130
- = 0.1.1 =
1131
-
1132
- * Fixed major bug, which gave 404 error when trying to use "Options" page.
1133
-
1134
- = 0.1 =
1135
-
1136
- * Option page to limit number of posts.
1137
- * Working using [category=ID] for posts and pages, with several categories support.
 
 
 
 
 
 
 
 
 
 
 
1
+ === List category posts ===
2
+ 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: 3.3
6
+ Tested up to: 4.7
7
+ Stable tag: 0.71
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ == Description ==
12
+ **This plugin is looking for maintainers!** Please [take a look at
13
+ this issue on
14
+ GitHub](https://github.com/picandocodigo/List-Category-Posts/issues/134).
15
+
16
+ List Category Posts allows you to list posts by category in a post or page using the `[catlist]` shortcode. When you're editing a page or post, directly insert the shortcode in your text and the posts will be listed there. The *basic* usage would be something like this:
17
+
18
+ `[catlist id=1]`
19
+
20
+ `[catlist name="news"]`
21
+
22
+ The shortcode accepts a category name or id, the order in which you
23
+ want the posts to display, and the number of posts to display. You can
24
+ also display the post author, date, excerpt, custom field values, even
25
+ the content! A lot of parameters have been added to customize what to
26
+ display and how to show it. Check [the full
27
+ documentation](https://github.com/picandocodigo/List-Category-Posts/wiki)
28
+ to learn about the different ways to use it.
29
+
30
+ The `[catlist]` shortcode can be used as many times as needed with
31
+ different arguments on each post/page.
32
+ `[catlist id=1 numberposts=10]`
33
+
34
+ There's an options page with only one option -for the moment-, new
35
+ options will be implemented on demand (as long as they make
36
+ sense). Right now the only global option is the `numberposts`
37
+ parameter, to define a default number of posts to show for each
38
+ instance (you can override this value by using the `numberposts`
39
+ parameter in your shortcode).
40
+
41
+ **[Read the instructions](https://github.com/picandocodigo/List-Category-Posts/wiki)** to learn which parameters are available and how to use them.
42
+
43
+ If you want to **List Categories** instead of posts you can use my other plugin **[List categories](http://wordpress.org/plugins/list-categories/)**.
44
+
45
+ You can find **Frequently Asked Questions** [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
46
+
47
+ **Customization**
48
+
49
+ The different elements to display can be styled with CSS. you can define an HTML tag to wrap the element with, and a CSS class for this tag. Check [the documentation](https://github.com/picandocodigo/List-Category-Posts/wiki) for usage.
50
+
51
+ Great to use WordPress as a CMS, and create pages with several categories posts.
52
+
53
+ **Widget**
54
+
55
+ The plugin includes a widget which works pretty much the same as the
56
+ plugin. Just add as many widgets as you want, and select all the
57
+ available options from the Appearence > Widgets page. Not all the
58
+ functionality in the shortcode has been implemented in the widget
59
+ yet. You can use the shortcode for the most flexibility.
60
+
61
+ Please, read the information on [the wiki](https://github.com/picandocodigo/List-Category-Posts/wiki)
62
+ and
63
+ [Changelog](http://wordpress.org/extend/plugins/list-category-posts/changelog/)
64
+ to be aware of new functionality, and improvements to the plugin.
65
+
66
+ **Videos**
67
+
68
+ Some users have made videos on how to use the plugin, (thank you! you people are awesome!). Check them out here:
69
+
70
+ * [Manage WordPress Content with List Category Posts Plugin](http://www.youtube.com/watch?v=kBy_qoGKpdo)
71
+ * [Build A Start Here Page with List Category Posts](http://www.youtube.com/watch?v=9YJpZfHIwIY)
72
+ * [WordPress: How to List Category Posts on a Page](http://www.youtube.com/watch?v=Zfnzk4IWPNA)
73
+
74
+ **Support the plugin**
75
+
76
+ If you've found the plugin useful, consider making a [donation via PayPal](http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support "Donate via PayPal") or visit my Amazon Wishlist for [books](http://www.amazon.com/gp/registry/wishlist/2HU1JYOF7DX5Q/ref=wl_web "Amazon Wishlist") or [comic books](http://www.amazon.com/registry/wishlist/1LVYAOJAZQOI0/ref=cm_wl_rlist_go_o) :).
77
+
78
+ **Development**
79
+
80
+ Development is being tracked on [GitHub](https://github.com/picandocodigo/List-Category-Posts). Fork it, code, make a pull request, suggest improvements, etc. over there. I dream of the day all of the WordPress plugins will be hosted on Git :)
81
+
82
+
83
+ ==Installation==
84
+
85
+ * Upload the `list-category-posts` directory to your wp-content/plugins/ directory.
86
+ * Login to your WordPress Admin menu, go to Plugins, and activate it.
87
+ * Start using the '[catlist]` shortcode in your posts and/or pages.
88
+ * You can find the List Category Posts widget in the Appearence > Widgets section on your WordPress Dashboard.
89
+ * If you want to customize the way the plugin displays the information, check [HTML & CSS Customization](https://github.com/picandocodigo/List-Category-Posts/wiki/HTML-&-CSS-Customization) or the [section on Templates](https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System) on the wiki.
90
+
91
+ ==Other notes==
92
+
93
+ Since the documentation on how to use the plugin has passed wordpress.org's character limit, the text was cut. I've since started using [a wiki](https://github.com/picandocodigo/List-Category-Posts/wiki) for more comfortable reading and maintaining. Please check it out, suggestions are welcome on GitHub issues!
94
+
95
+ ==Instructions on how to use the plugin==
96
+
97
+ ==SELECTING THE CATEGORY==
98
+ The plugin can figure out the category from which you want to list posts in several ways. **You should use only one of these methods** since these are all mutually exclusive, weird results are expected when using more than one:
99
+
100
+ * Using the *category id*.
101
+ * **id** - To display posts from a category using the category's id. Ex: `[catlist id=24]`.
102
+ * The *category name or slug*.
103
+ * **name** - To display posts from a category using the category's name or slug. Ex: `[catlist name=mycategory]`
104
+ * *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.
105
+ * **categorypage** - Set it to "yes" if you want to list the posts from the current post's category. `[catlist categorypage="yes"]`
106
+
107
+ When using List Category Posts whithout a category id, name or slug, it will post the latest posts from **every category**.
108
+
109
+ ==USING MORE THAN ONE CATEGORY==
110
+
111
+ * 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]`.
112
+ * 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]`.
113
+ * **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.
114
+
115
+ ==Other ways of selecting what posts to show==
116
+
117
+ * **child_categories** - Exclude/include posts from the child categories. By default they are included. If you have a "Parent Category" and you use: `[catlist name="Parent Category"]`, you'll see posts from it's child categories as if they were posts from the same category. You can use this parameter to exclude these posts: `[catlist name="Parent Category" child_categories=false]`.
118
+
119
+ * **author_posts** - Get posts by author. Use 'user_nicename' (NOT
120
+ name). Example: `[catlist author_posts="fernando"]`
121
+
122
+ * **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"]`.
123
+
124
+ * **taxonomy** - You can select posts using custom taxonomies. You need to set the taxonomy and the terms: `[catlist taxonomy='person' terms='bob']`.
125
+
126
+ * **currenttags** - Display posts from the current post's tags (won't
127
+ work on pages since they have no tags). Pass it the 'yes' string for it to work: `[catlist currenttags="yes"]`
128
+
129
+ * **exclude_tags** - Exclude posts from one or more tags: `[catlist tags="videogames" exclude_tags="sega,sony"]`
130
+
131
+ * **starting_with** - Get posts whose title starts with a certain
132
+ letter. Example: `[catlist starting_with="l"]` will list all posts
133
+ whose title starts with L. You can use several letters: `[catlist starting_with="m,o,t"]`.
134
+
135
+ * **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.
136
+
137
+ * **date ranges** - You can also use date ranges for listing posts. For example "list every post after March 14th, 2005". The parameters are: ```after, after_year, after_month, after_day, before, before_year, before_month, before_day```. These parameters are used to specify data_query arguments (see: [the codex](https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters)).
138
+
139
+ If you want to list all the posts before a given date, say `Jun 17th, 2007` you can use these two options:
140
+ `[catlist before_year=2007 before_month=06 before_day=17]`
141
+ Or you can use the `before` parameter with a [strtotime()-compatible string](http://php.net/manual/en/datetime.formats.date.php):
142
+ `[catlist before='2007/06/17']`
143
+
144
+ The same works for posts after a given date, you can use:
145
+ `[catlist after_year=2007 after_month=06 after_day=17]`
146
+ Or just `after` with a [strtotime()-compatible string](http://php.net/manual/en/datetime.formats.date.php):
147
+ `[catlist after='2007/06/17']`
148
+
149
+ `after` takes priority over `after_year`, `after_month`, and `after_day`.
150
+ `before` takes priority over `before_year`, `before_month`, and `before_day`.
151
+
152
+ * **search** - List posts that match a search term. `[catlist search="The Cake is a lie"]`
153
+
154
+ * **excludeposts** - IDs of posts to exclude from the list. Use 'this' to exclude the current post. Ex: `[catlist excludeposts=this,12,52,37]`
155
+
156
+ * **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.
157
+
158
+ * **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]`
159
+
160
+ * **post_status** - use post status, default value is 'publish'. Valid values:
161
+ * **publish** - a published post or page.
162
+ * **pending** - post is pending review.
163
+ * **draft** - a post in draft status.
164
+ * **auto-draft** - a newly created post, with no content.
165
+ * **future** - a post to publish in the future.
166
+ * **private** - not visible to users who are not logged in.
167
+ * **inherit** - a revision. see get_children.
168
+ * **trash** - post is in trashbin (available with Version 2.9).
169
+ * **any** - retrieves any status except those from post types with 'exclude_from_search' set to true.
170
+ You can use several post statuses. Example: `[catlist post_status="future, publish" excludeposts=this]`
171
+
172
+ * **show_protected** - Show posts protected by password. By default
173
+ they are not displayed. Use: `[catlist show_protected=yes]`
174
+
175
+ * **post_parent** - Show only the children of the post with this ID.
176
+ Default: None.
177
+
178
+ * **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.
179
+
180
+ ==PAGINATION
181
+
182
+ https://github.com/picandocodigo/List-Category-Posts/wiki/Pagination
183
+
184
+ ==OTHER PARAMETERS==
185
+
186
+ * **conditional_title** - Display a custom title before the posts list.
187
+ The title is not displayed if the list is empty. Set to the empty string
188
+ (default value) to disable.
189
+ Example: `[catlist conditional_title="Other posts"]`.
190
+
191
+ * **conditional_title_tag** - Specify the tag used for the conditional title.
192
+ Defaults to 'h3'.
193
+
194
+ * **conditional_title_class** - Specify the class used for the conditional
195
+ title. Defaults to the empty string (no special class).
196
+
197
+ * **orderby** - To customize the order. Valid values are:
198
+ * **author** - Sort by the numeric author IDs.
199
+ * **category** - Sort by the numeric category IDs.
200
+ * **content** - Sort by content.
201
+ * **date** - Sort by creation date.
202
+ * **ID** - Sort by numeric post ID.
203
+ * **menu_order** - Sort by the menu order. Only useful with pages.
204
+ * **mime_type** - Sort by MIME type. Only useful with attachments.
205
+ * **modified** - Sort by last modified date.
206
+ * **name** - Sort by stub.
207
+ * **parent** - Sort by parent ID.
208
+ * **password** - Sort by password.
209
+ * **rand** - Randomly sort results.
210
+ * **status** - Sort by status.
211
+ * **title** - Sort by title.
212
+ * **type** - Sort by type. Ex: `[catlist name=mycategory orderby=date]`
213
+
214
+ * **customfield_orderby** - You can order the posts by a custom field. For example: `[catlist numberposts=-1 customfield_orderby=Mood order=desc]` will list all the posts with a "Mood" custom field. Remember the default order is descending, more on order:
215
+
216
+ * **order** - How to sort **orderby**. Valid values are:
217
+ * **ASC** - Ascending (lowest to highest).
218
+ * **DESC** - Descending (highest to lowest). Ex: `[catlist name=mycategory orderby=title order=asc]`
219
+
220
+ * **numberposts** - Number of posts to return. Set to 0 to use the max
221
+ number of posts per page. Set to -1 to remove the limit.
222
+ Ex: `[catlist name=mycategory numberposts=10]`
223
+ You can set the default number of posts globally on the options
224
+ page on your Dashboard in Settings / List Category Posts.
225
+
226
+ * **no_posts_text** - Text to display when no posts are found. If you
227
+ don't specify it, nothing will get displayed where the posts
228
+ should be.
229
+
230
+ * **date** - Display post's date next to the title. Default is 'no',
231
+ use date=yes to activate it. You can set a css class and an html
232
+ tag to wrap the date in with `date_class` and `date_tag` (see HTML
233
+ & CSS Customization further below).
234
+
235
+ * **date_modified** - Display the date a post was last modified next
236
+ to the title. You can set a css class and an html tag to wrap the
237
+ date in with `date_modified_class` and `date_modified_tag` (see
238
+ HTML & CSS Customization further below).
239
+
240
+ * **author** - Display the post's author next to the title. Default is
241
+ 'no', use author=yes to activate it. You can set a css class and an html
242
+ tag to wrap the author name in with `author_class` and `author_tag` (see HTML
243
+ & CSS Customization further below).
244
+
245
+ When displaying the post author, you can also display a link to the
246
+ author's page. The following parameter **only works if author=yes
247
+ is present in the shortcode**:
248
+
249
+ * **author_posts_link** - Gets the URL of the author page for the
250
+ author. The HTML and CSS customization are the ones applied to `author`.
251
+
252
+ * **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.
253
+
254
+ * **excerpt** - Display a plain text excerpt of the post. Default is 'no', use `excerpt=yes` or `excerpt=full` to activate it. If you have a separate excerpt in your post, this text will be used. If you don't have an explicit excerpt in your post, the plugin will generate one from the content, striping its images, shortcodes and HTML tags. If you want to overwrite the post's separate excerpt with an automatically generated one (may be useful to allow HTML tags), use `excerpt_overwrite=yes`.
255
+
256
+ If you use `excerpt=yes`, the separate excerpt or content will be limited to the number of words set by the *excerpt_size* parameter (55 words by default).
257
+
258
+ If you use `excerpt=full` the plugin will act more like Wordpress. If the post has a separate excerpt, it will be used in full. Otherwise if the content has a &lt;!--more--&gt; tag then the excerpt will be the text before this tag, and if there is no &lt;!--more--&gt; tag then the result will be the same as `excerpt=yes`.
259
+
260
+ If you want the automatically generated excerpt to respect your theme's allowed HTML tags, you should use `excerpt_strip=no`, otherwise the HTML tags are automatically stripped.
261
+
262
+ * **excerpt_size** - Set the number of *words* to display from the excerpt. Default is 55. Eg: `excerpt_size=30`
263
+
264
+ * **excerpt_strip** - Set it to `yes` to strip the excerpt's HTML tags. If the excerpt is auto generated by the plugin, the HTML tags will be stripped, and you should use `excerpt_strip=no` to see the excerpt with HTML formatting.
265
+
266
+ * **title_limit** - Set the limit of characters for the title. Ex:
267
+ `[catlist id=2 title_limit=50]` will show only the first 50
268
+ characters of the title and add "…" at the end.
269
+
270
+ * **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:
271
+
272
+ * `yes` - Show the excerpt or full content of the post. If there's a &lt;!--more--&gt; 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]`
273
+
274
+ * `full` - Show the full content of the post regardless of whether there is a &lt;!--more--&gt; tag in the post. Ex: `[catlist content=full]`
275
+
276
+ * **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.
277
+
278
+ * **category_description** Show the category description wrapped in a p tag: `[catlist id=1 category_description='yes']`
279
+
280
+ * **catname** - Show the title of the category (or categories), works exactly as `catlink`, but it doesn't add a link to the category.
281
+
282
+ * **category_count** - Shows the posts count in that category, only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]`
283
+
284
+ * **comments** - Show comments count for each post. Default is 'no'. Ex: `[catlist comments=yes]`.
285
+
286
+ * **thumbnail** - Show post thumbnail (http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/). Default is 'no'. Ex: `[catlist thumbnail=yes]`.
287
+
288
+ * **force_thumbnail** - If the previous parameter is set to 'yes', and there's no featured image, setting this to 'yes' or 'true' will make the plugin look for the first image in the post and use it as a thumbnail. Ex: `[catlist thumbnail=yes force_thumbnail=yes]`.
289
+
290
+ * **thumbnail_size** - Either a string keyword (thumbnail, medium, large or full) or 2 values representing width and height in pixels. Ex: `[catlist thumbnail_size=32,32]` or `[catlist thumbnail_size=thumbnail]`
291
+
292
+ * **thumbnail_class** - Set a CSS class for the thumbnail.
293
+
294
+ * **post_suffix** - Pass a String to this parameter to display this
295
+ String after every post title.
296
+ Ex: `[catlist numberposts=-1
297
+ post_suffix="Hello World"]` will create something like:
298
+
299
+ ```<ul class="lcp_catlist" id=lcp_instance_0>
300
+ <li>
301
+ <a href="http://127.0.0.1:8080/wordpress/?p=42" title="WordPress">
302
+ WordPress
303
+ </a> Hello World </li>```
304
+
305
+ * **display_id** - Set it to yes to show the Post's ID next to the post title: `[catlist id=3 display_id=yes]`
306
+
307
+ * **class** - CSS class for the default UL generated by the plugin.
308
+
309
+ * **tags_as_class** - Use a post's tags as a class for the `li` that lists the posts. Default is `no`. For example, `[catlist tags_as_class=yes]` will show a post that has the `fun` tag like this:
310
+ ```
311
+ <li class=" fun ">
312
+ <a href="http://localhost:8080/?p=1267" title="Post Title">Post Title</a>
313
+ </li>
314
+ ```
315
+
316
+ * **customfield_display** - Display custom field(s). You can specify
317
+ many fields to show, separating them with a coma. If you want to
318
+ display just the value and not the name of the custom field, use
319
+ `customfield_display_name` and set it to no.
320
+ By default, the custom fields will show inside a div with a
321
+ specific class: `<div class="lcp-customfield">`. You can customize
322
+ this using the customfield_tag and customfield_class parameters to
323
+ set a different tag (instead of the div) and a specific class
324
+ (instead of lcp-customfield).
325
+
326
+ * **customfield_display_glue** - Specify the text to appear between two custom
327
+ fields if displayed together, defaults to the empty string. Not used if
328
+ the `customfield_display_separately` parameter is defined.
329
+
330
+ * **customfield_display_separately** - Display the custom fields separately.
331
+ Each custom field is displayd within its own tag (see `customfield_tag`).
332
+ Defaults to 'no', set to 'yes' to enable. Superseeds the
333
+ `customfield_display_glue` parameter when enabled.
334
+
335
+ * **customfield_display_name** - To use with `customfield_display`.
336
+ Use it to just print the value of the Custom field and not the
337
+ name. Example:
338
+ `[catlist numberposts=-1 customfield_display="Mood"
339
+ customfield_display_name="no"]`
340
+ Will print the value of the Custom Field "Mood" but not the text
341
+ "Mood: [value]".
342
+
343
+ * **customfield_display_name_glue** - To use with `customfield_display_name`.
344
+ Use it to specify the text between the name and the value, defaults to
345
+ ' : '.
346
+
347
+ * **template** - By default, posts will be listed in an unordered list
348
+ (ul tag) with the class 'lcp_catlist':
349
+
350
+ `<ul class="lcp_catlist"><li><a href="post1">Post 1</a></li>...`
351
+
352
+ You can use a different class by using the *class* parameter.
353
+
354
+ You can create your own template file (Check **Template System**
355
+ further down this document) and pass it as a parameter here. The
356
+ parameter is the template name without the extension. For example
357
+ for `mytemplate.php`, the value would be `mytemplate`.
358
+
359
+ You can also pass these two parameters which yield different
360
+ results:
361
+ * `div` - This will output a div with the `lcp_catlist` class
362
+ (or one you pass as a parameter with the `class` argument). The
363
+ posts will be displayed between p tags. `[catlist template=div]`
364
+
365
+ * `ol` - This will output an ordered list with the `lcp_catlist`
366
+ css class (or the one you pass as a parameter with the `class`
367
+ argument) and each post will be a list item inside the ordered list. `[catlist template=ol]`.
368
+
369
+ * **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"]`
370
+
371
+ * **posts_morelink** - Include a "read more" link after each post. It receives a string of characters as a parameter which will be used as the text of the link. Example: `[catlist id=38 posts_morelink="Read more about this post"]`
372
+
373
+ * **link_target** - Select the `target` attribute for links to posts (target=_blank, _self, _parent, _top, *framename*). Example: `[catlink id=3 link_target=_blank]` will create: `<a href="http://localhost/wordpress/?p=45" title="Test post" target="_blank">Test post</a>`
374
+
375
+ * **no_post_titles** - If set to `yes`, no post titles will be shown. This may make sense together with `content=yes`.
376
+
377
+ * **link_titles** - Option to display titles without links. If set to `false`, the post titles won't be linking to the article.
378
+
379
+ * **link_dates** - Option to wrap dates with a link to the post. Set to `true` or `yes` to enable, set to `false` or `no` to disable. Defaults to `false`.
380
+
381
+ == Widget ==
382
+
383
+ The widget is quite simple, and it doesn't implement all of the plugin's functionality. To use a shortcode in a widget add this code to your theme's functions.php file:
384
+
385
+ `add_filter('widget_text', 'do_shortcode');`
386
+
387
+ Then just add a new text widget to your blog and use the shortcode there as the widget's content.
388
+
389
+ == HTML & CSS Customization ==
390
+
391
+ https://github.com/picandocodigo/List-Category-Posts/wiki/HTML-&-CSS-Customization
392
+
393
+ == Template System ==
394
+
395
+ https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System
396
+
397
+ == Frequently Asked Questions ==
398
+
399
+ **FAQ**
400
+
401
+ You can find the Frequently Asked Questions [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
402
+
403
+ **INSTRUCTIONS ON HOW TO USE THE PLUGIN**
404
+
405
+ https://github.com/picandocodigo/List-Category-Posts/wiki/
406
+
407
+ Please read the instructions and the FAQ before opening a new topic in the support forums.
408
+
409
+ **TEMPLATE SYSTEM**
410
+
411
+ How to customize the way the posts are shown: https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System. I am aware the Template System is not the friendliest right now, I'll work on improving this if I ever get the time to work on it.
412
+
413
+ **NEW FEATURE REQUESTS, BUG FIXES, ENHANCEMENTS**
414
+
415
+ You can post them on [GitHub Issues](https://github.com/picandocodigo/List-Category-Posts/issues).
416
+
417
+ **FURTHER QUESTIONS**
418
+
419
+ For questions either use the [Support forum](http://wordpress.org/support/plugin/list-category-posts) or [WordPress Answers](http://wordpress.stackexchange.com/) (just [ask your question](http://wordpress.stackexchange.com/questions/ask?tags=plugin-list-category-posts) using the 'plugin-list-category-post' tag).
420
+
421
+ == Upgrade Notice ==
422
+
423
+ = 0.66 =
424
+ Full release notes:
425
+ https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
426
+
427
+ = 0.65 =
428
+ Full release notes here: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.65
429
+
430
+ = 0.37 =
431
+
432
+ When using `content=yes`, if the post has a more tag, the plugin will only show the content previous to the more tag and not all the content as it used before (it now supports the more tag the same way as WordPress).
433
+
434
+ = 0.34 =
435
+ * Now the plugin accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will sorround the element between span tags and the given CSS class. Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) under **HTML & CSS Customization** for more info.
436
+ * Fixed bug on `post_status`, it used to show all published posts and if user was logged in, all private ones too. Now you can specify 'private' to just display private posts, and draft, publish, draft, etc (See **post_status** param on the [instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for more info).
437
+
438
+ = 0.25 =
439
+ * Translation support.
440
+
441
+ = 0.18 =
442
+ Template system was upgraded with new options. Backwards compatible, but you can better customize the way the post contents are displayed. Check templates/default.php.
443
+
444
+ = 0.17 =
445
+ Upgrade your templates: Templates system was rewritten, so your current templates will probably not work. Check out the new default.php file on /templates to see the simpler new way to work with templates.
446
+
447
+ = 0.13.2 =
448
+ Thumbnail parameter 'thumbnails' changed to 'thumbnail.
449
+
450
+ = 0.7.2 =
451
+ Template system has changed. Now the posts loop must be defined inside the template. Check templates/default.php for an example.
452
+
453
+ = 0.8 =
454
+ Widget built for WordPress 2.8's Widget API, so you need at least WP 2.8 to use the widget.
455
+
456
+ = 0.9 =
457
+ Template system has changed. Custom templates should be stored in WordPress theme folder.
458
+
459
+ == Changelog ==
460
+
461
+ = 0.71 =
462
+
463
+ * Added tags_as_class: Use a post's tags as a class for the li that lists the posts. Default is no. Thanks @vacuus on GitHub for this PR!
464
+
465
+ = 0.70 =
466
+
467
+ * Fixed [customfield_class and customfield_tag issues](https://github.com/picandocodigo/List-Category-Posts/issues/201). Thanks [vacuus](https://github.com/vacuus)!!
468
+ * Tested up to WordPress 4.6.1
469
+ * Added date range, thanks again [vacuus](https://github.com/vacuus)!! Check [the docs](https://github.com/picandocodigo/List-Category-Posts/wiki/How-to-select-which-posts-to-show) to read how to use this.
470
+
471
+ = 0.69 =
472
+
473
+ * Update lcp-widget.php for PHP 7 compatibility. Thanks @kenshin23!
474
+
475
+ = 0.68 =
476
+
477
+ Thanks @mmatthews1981, @ottadvantage and @mhoeher for their contributions on this version:
478
+
479
+ * Adds Alt Tag to thumbnail
480
+ * Handle child_categories flag correctly - https://github.com/picandocodigo/List-Category-Posts/pull/185
481
+ * Adds a default value to numberposts on plugin activation - https://github.com/picandocodigo/List-Category-Posts/pull/193
482
+
483
+
484
+ = 0.67.1 =
485
+ * Bugfix release, this should fix the issues with Parent Categories listings.
486
+
487
+ = 0.67 =
488
+ * Adds custom css class to current page in pagination `lcp_currentpage`.
489
+ * Adds child_categories parameter to being able to exclude child categories' posts from a list.
490
+ * New feature to look for the first image in a post when requesting a thumbnail and the post has no featured image. Thanks Michael J. Gibbs for writing this code :)
491
+
492
+ = 0.66 =
493
+ * Full release notes: https://github.com/picandocodigo/List-Category-Posts/releases/tag/0.66
494
+ * Orders the README a bit.
495
+ * Issues with tags when using more than one tag for OR and AND relationships should be fixed.
496
+ * 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!
497
+ * Adds category description parameter.
498
+ * Adds orderby and order to options page. Removes default values since they're the default anyway.
499
+
500
+ = 0.65 =
501
+
502
+ * Adds pagination parameter to the options page.
503
+ * Changes the loop in the default template.
504
+ * Fixes 'morelink_class not working with templates' in the default template.
505
+ * Adds link to post wrapper for the post date. If you have a chance, please thank [bibz](https://github.com/bibz) who is doing awesome Pull Requests to this plugin and occasionally helping out on the support forums here too :)
506
+
507
+ = 0.64 =
508
+
509
+ * Fixes get_current_tags
510
+ * Some updates on the documentation
511
+ * Introduces a conditional title, only displayed when posts are found, thanks [bibz](https://github.com/bibz) for this Pull Request!
512
+ * Introduces `customfield_display_separately`, `customfield_display_glue` and `customfield_display_name_glue` parameters for multiple custom fields handling by bibz. Thanks! :D
513
+
514
+ = 0.63.1 =
515
+ * Remove renamed file (Damn using subversion), should fix issues updating.
516
+
517
+ = 0.63 =
518
+
519
+ * Vagrant box and development environment improved by bibz
520
+ * Tested with WordPress 4.3, updated Widget constructor because of [PHP 4 deprecation](https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/).
521
+
522
+ = 0.62 =
523
+
524
+ * Dutch translation by Gerhard Hoogterp, thank you!
525
+ * Re-add the loop fixes and fixes function missing from last time by Sophist-UK, thanks!
526
+ * Allow to order by the modified date in the widget by bibz, thanks!
527
+
528
+ = 0.61 =
529
+
530
+ * Adds Portuguese from Portugal (pt_PT) translation, muito obrigado Joaquim Félix!
531
+ * Fixes translation paths, [thanks monpelaud](https://wordpress.org/support/topic/error-of-name-on-some-translation-files-1)!.
532
+
533
+
534
+ = 0.60.1 =
535
+
536
+ * Reverts switching to the loop til we find a way around for using templates.
537
+
538
+ = 0.60 =
539
+
540
+ * Fixes the loop so that other plugins work as if this was a blog or archive post.
541
+ See [issue #156](https://github.com/picandocodigo/List-Category-Posts/issues/156)
542
+ on Github. Thanks Sophist-UK for this new version :)
543
+
544
+ = 0.59.2 =
545
+
546
+ * Tested with WordPress 4.2
547
+ * Sophist's fix: Check for multi-byte functions installed and use ascii functions if not.
548
+
549
+ = 0.59.1 =
550
+
551
+ * Fix some errors
552
+
553
+ = 0.59 =
554
+
555
+ **Thanks Sophist from UK for this release** :)
556
+
557
+ By Sophist:
558
+
559
+ * Fix error causing call to undefined method
560
+ * Add excerpt=full to allow either full explicit excerpt or use <?--more--> to define where the excerpt ends.
561
+ * Fixes link_titles=false creates plain text rather than unlinked formatted text as you might expect.
562
+ * Fixes title_limit not working correctly
563
+
564
+ Other minor fixes by me.
565
+
566
+ = 0.58.1 =
567
+ * Fixes an error with pagination links. Accessing $_SERVER filtered not working on some servers, have to investigate further for a future version.
568
+ * Addresses warning messages when debug enabled.
569
+
570
+ = 0.58 =
571
+ * Removes filter interfering with filters set by other plugins. Thanks [zulkamal](https://github.com/zulkamal) for the Pull Request!
572
+ * Adds option to display titles without links. Thanks zulkamal for this Pull Request too! :D
573
+ * Workaround to prevent '?&' to appear in URLs. Thanks [mhoeher](https://github.com/mhoeher) for the Pull Request!
574
+ * General refactors for improving code quality/security.
575
+ * Fixed typo in Readme (Thanks Irma!).
576
+ * Fixes excluding tags when using category name (should fix other issues with category name too since there was a bug there).
577
+
578
+ = 0.57 =
579
+ * Add custom image sizes to the list of selectable image sizes in the widget. Thanks [nuss](https://github.com/nuss) for the Pull Request!
580
+ * New Attribute 'no_post_titles'. Thanks [thomasWeise](https://github.com/thomasWeise) for the Pull Request!
581
+ * Finnish localization. Thanks [Newman101](https://github.com/Newman101) for the Pull Request!
582
+
583
+ = 0.56 =
584
+ * Adds Indonesian (Bahasa Indonesia) translation. Thanks Dhyayi Warapsari!
585
+ * Adds french from France language. Thanks Dorian Herlory!
586
+ * Adds content=full parameter to ignore <!--more--> tags when displaying content. Thanks Sophist-UK!
587
+ * Fixes excluded_tags parameter
588
+
589
+ = 0.55 =
590
+ * Ordered lists now follow the posts count when using pagination - https://wordpress.org/support/topic/templateol-resets-count-when-using-pagination
591
+ * Fixes issue introduced in 0.54 with undefined indexes - https://wordpress.org/support/topic/problem-continues-with-0542
592
+
593
+ = 0.54.2 =
594
+ * Fixes call to undefined method lcp_get_current_post_id()
595
+
596
+ = 0.54.1 =
597
+ * Fixes bug in LcpParameters.
598
+
599
+ = 0.54 =
600
+ * Adds http/https check for pagination links.
601
+ * Fixes `post_status` and `post_type` parameters for using multiple post statuses and types.
602
+ * Big refactor: Thumbnail code, parameters moved to new class,
603
+ created util class, removed bad and repeated code, moved category
604
+ code to new class. Small fixes all around the place. Went from a
605
+ very bad 1.77 GPA to 3.23 on CodeClimate.
606
+
607
+
608
+ = 0.53 =
609
+ * Makes "starting_with" parameter accept several letters, by Diego Sorribas. Thank you!
610
+
611
+ = 0.52 =
612
+ * Small fix for pagination and query string.
613
+ * Fix on multiple categories with AND relationship.
614
+ * Fixes options page 404 and saving options.
615
+ * Tested with WordPress 4.1.
616
+
617
+ = 0.51 =
618
+ * Fixes translations, updates Spanish translation. Translators, please update your po and mo files and submit them via pull request on GitHub :)
619
+ * Test compatibility with WordPress 4.0
620
+ * Adds icon for WordPress 4.0 new plugin interface.
621
+ * Fixes posts_morelink and customfields for templates.
622
+ * Adds fixes by [htrex](https://github.com/htrex):
623
+ * Fix custom template regression
624
+ * Fix excluded categories not working in widget
625
+
626
+ = 0.50.3 =
627
+
628
+ * Addresses some warnings / scandir on Displayer and catname on widget
629
+ * Fixes lcp_paginator.css path
630
+ * Some small sanitations
631
+
632
+ = 0.50.2 =
633
+
634
+ * Small fix on templates
635
+
636
+ = 0.50.1 =
637
+
638
+ * Fixes issue with catlink.
639
+ * Fixes issue with templates named "default"
640
+
641
+ = 0.50 =
642
+
643
+ * Adds Thai translation by [itpcc](https://github.com/itpcc).
644
+ * The widget can now select an existing template. Thanks [Borjan Tchakaloff](https://github.com/bibz)!
645
+ * Templates code was refactored.
646
+
647
+ = 0.49.1 =
648
+
649
+ * Makes sure "starting_with" queries are case insesitive.
650
+ * Fixes category link on 'catlink' and 'catname' parameters (were showing twice)
651
+
652
+ = 0.49 =
653
+
654
+ * Adds `author_posts_link`, to show an author's page.
655
+ * Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the [forum](http://wordpress.org/support/topic/a-couple-of-suggestions-and-one-teensy-error).
656
+ * Small bug fix for getting current category. Used to check against simple string, now checking against i18n'ed one.
657
+
658
+ = 0.48 =
659
+
660
+ * Bug fixes
661
+ * Adds parameter to show modified date of posts. Thanks Eric Sandine for the Pull Request :)
662
+
663
+ = 0.47 =
664
+
665
+ * Adds Ukranian translation by Michael Yunat [http://getvoip.com](http://getvoip.com/blog)
666
+ * Adds `display_id` parameter. Set it to yes to show the Post's ID next to the post title.
667
+ * Adds `starting_with` parameter. Gets posts whose title start with a given letter.
668
+
669
+
670
+ = 0.46.4 =
671
+ * Finally (hopefully) fix the excerpt issues.
672
+
673
+ = 0.46.3 =
674
+ * Fix something that I broke on previous update for excerpt :S
675
+
676
+ = 0.46.2 =
677
+ * Some fixes on displaying excerpt.
678
+
679
+ = 0.46.1 =
680
+ * Fixes quotes bug on title tag.
681
+ * Only show ellipsis when title.size > title_limit when using the
682
+ title_limit param.
683
+
684
+ = 0.46 =
685
+ * Adds "the_excerpt" filter to excerpt to improve compatibility with
686
+ the [Jetpack](http://wordpress.org/plugins/jetpack/) plugin.
687
+ * Add character limit to title
688
+ * Removes debug warnings
689
+ * Output valid HTML, attribute quotations - thanks Nikolaus Demmel!
690
+
691
+ = 0.45 =
692
+ * Adds ol default template to `template` parameter.
693
+ * Improves documentation.
694
+
695
+ = 0.44.1 =
696
+ * Removes warning when using current tag in pages
697
+ * Small fix on Readme
698
+
699
+ = 0.44 =
700
+ * Adds the feature to get an author's posts
701
+ * Adds show posts from current post's tags.
702
+
703
+ = 0.43.1 =
704
+ * Show "no posts text" only if it's been set and there are no posts,
705
+ otherwise behave like before.
706
+
707
+ = 0.43 =
708
+ * Removes filters to order by (should fix issues with order)
709
+ * Adds `pagination_prev` and `pagination_next` params to customize
710
+ the "Previous" and "Next" buttons on pagination navigation.
711
+ * Only show pages in pagination when they are > 1
712
+ * Adds `no_posts_text` param to display a custom message when no
713
+ posts are found
714
+ * Fixes "morelink" class parameter (now can be used without
715
+ specifying an HTML tag and the class is applied to the a tag).
716
+
717
+ = 0.42.3 =
718
+ * Adds missing title attribute from thumbnail links.
719
+
720
+ = 0.42.2 =
721
+ * Fixes pagination numbers
722
+ * Removes warning on wp-debug set to true
723
+
724
+ = 0.42.1 =
725
+ * Fixes some debug warnings (Ruby's nil doesn't apply in the PHP World)
726
+
727
+ = 0.42 =
728
+ * Fixes excludeposts=this.
729
+ * Adds customfield_tag and customfield_class to customize an HTML tag
730
+ and CSS class for custom fields.
731
+
732
+ = 0.41.2 =
733
+ * Small bugfix with customfield_display_name (wasn't working now it
734
+ is)
735
+
736
+ = 0.41.1 =
737
+ * Fixes customfield display name.
738
+ * Fixes size in getting thumbnails, now checks for all available
739
+ sizes and defaults ("thumbnail", "full", etc.)
740
+
741
+ = 0.41.0 =
742
+ * Adds options page, to set the default numberposts value globally.
743
+ * Adds `customfield_display_name` param.
744
+ * Adds pagination to custom template.
745
+ * Fixes date display.
746
+ * Adds conditions to Vagrantfile to boot faster and not repeat work.
747
+ * Fixes exclude posts, broken when migrating from get_posts to
748
+ WP_Query.
749
+
750
+ = 0.40.1 =
751
+
752
+ * Small fix closing quotes on content when using <!--more-->
753
+
754
+ = 0.40 =
755
+
756
+ * Tested with WordPress 3.8
757
+ * Removes unnecessary stuff on wp_enqueue_styles
758
+ * Fixes validation when using quotes in title
759
+ * Fixes on <!--more--> tag
760
+ * Fixes on title HTML tag and CSS class. (*See HTML & CSS
761
+ Customization* on [Other Notes](http://wordpress.org/plugins/list-category-posts/other_notes/) to check the expected behaviour)
762
+
763
+ = 0.39 =
764
+
765
+ * Adds "post suffix" parameter, to add a String after each post
766
+ listed. [Source](http://wordpress.org/support/topic/hack-post-title-adding-elements)
767
+
768
+ = 0.38 =
769
+
770
+ * Adds pagination. Check **Pagination** on [Other
771
+ notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/)
772
+ to learn how to use it.
773
+ * Adds "How to display thumbnails next to title" to the FAQ.
774
+ * Adds a Vagrant box for developers to be able to start coding with
775
+ no effort :)
776
+
777
+ = 0.37 =
778
+ * Supports `more` tag. If there's a &lt;!--more--&gt; tag in the post, then it will behave just as WordPress does: only show the content previous to the more tag.
779
+ * Fixes YouTube thumbnails: Includes "embed" urls for youtube video
780
+ thumbnails, makes correct img tag when using CSS class.
781
+
782
+ = 0.36.2 =
783
+
784
+ * Fixed category_count for several categories.
785
+
786
+ = 0.36.1 =
787
+
788
+ * Fixed catlink to display titles for all the categories when using more than one category.
789
+
790
+ = 0.36 =
791
+
792
+ * Adds option for "target=_blank" for post links.
793
+ * Adds option to exclude category when using the *and* relationship: `[catlist id=1+2-3]` will include posts from categories 1 and 2 but not 3.
794
+
795
+ = 0.35 =
796
+ * Updated Turkish translation, thanks again [Hakan Er](http://hakanertr.wordpress.com/)!
797
+ * Adds feature to order by custom field using the `customfield_orderby` parameter.
798
+
799
+ = 0.34.1 =
800
+ * Bugfix (removed var_dump)
801
+
802
+ = 0.34 =
803
+ * Now accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will wrap the element between span tags and the given CSS class. Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) under **HTML & CSS Customization** for more info.
804
+ * Fixed bug on `post_status`, it used to show all published posts and if user was logged in, all private ones too. Now you can specify 'private' to just display private posts, and draft, publish, draft, etc (See **post_status** param on the [instructions](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for more info).
805
+
806
+ = 0.33 =
807
+ * Fixes bug with thumbnail size on Widget.
808
+ * Adds feature to make widget title a link to the category. Use 'catlink' as the value for the widget's title to make it a link to the category (based on https://github.com/picandocodigo/List-Category-Posts/pull/51/).
809
+ * Fixes morelink styiling with CSS class and tag.
810
+ * Adds morelink to templates (based on https://github.com/picandocodigo/List-Category-Posts/pull/48/)
811
+ * Fixes tag and CSS class for "catlink" too: http://wordpress.org/support/topic/cat_link-tag-does-not-seem-to-be-working
812
+
813
+ = 0.32 =
814
+ * Add category count parameter to show the number of posts in a category next to its title. Only works when using the **catlink** option: `[catlist name=nintendo catlink=yes category_count=yes]` - http://wordpress.org/support/topic/count-feature
815
+
816
+ = 0.31 =
817
+ * Pull request from @cfoellmann, adds testing environment and Travis CI integration. Awesomeness.
818
+ * When searching for a thumbnail, if there's no thumbnail on the post but there's a YouTube video, display the YouTube video thumbnail. (wordpress.org/support/topic/youtube-thumbnail)
819
+
820
+ = 0.30.3 =
821
+ * Bugfix release, fixes current category for post/page
822
+
823
+ = 0.30.2 =
824
+ * Improves 'current category' detection.
825
+ * Adds categorypage parameter to widget
826
+
827
+ = 0.30.1 =
828
+ * **excerpt** - Fixed default excerpt behaviour from previous release. By default it **will** strip html tags as it always did. If you want it not to strip tags, you'll have to use `excerpt_strip=no`. Added a new parameter to have a consistent excerpt. If you want to overwrite WordPress' excerpt when using the plugin and generate one the way the plugin does when there's no excerpt, use `excerpt_overwrite=yes`.
829
+
830
+ = 0.30 =
831
+ * Adds ability to exclude tags.
832
+ * Changes excerpt. Since lot of users have asked for it, I once again modified the way the excerpt is shown. It now respects your theme's allowed HTML tags and doesn't strip them from the excerpt. If you want to strip tags, use `excerpt_strip=yes`.
833
+
834
+ = 0.29 =
835
+ * Adds turkish translation, thanks [Hakan Er](http://hakanertr.wordpress.com/) for writing this translation! :)
836
+ * Adds "AND" relationship to several categories. Thanks to [hvianna](http://wordpress.org/support/profile/hvianna) from the WordPress forums who [implemented this feature](http://wordpress.org/support/topic/list-only-posts-that-belong-to-two-or-more-categories-solution) :D
837
+ * More improvements on readme.
838
+
839
+ = 0.28 =
840
+ * Improvements on readme, faqs.
841
+ * New posts_morelink param: adds a 'read more' link to each post.
842
+
843
+ = 0.27.1 =
844
+
845
+ * Sets minimum version to WordPress 3.3, since wp_trim_words was introduced in that version. Adds workaround for people using WordPress < 3.3.
846
+ * Adds Slovak translation by Branco from [WebHostingGeeks.com](http://webhostinggeeks.com/blog/).
847
+ * Removes Debug PHP warnings.
848
+ * Checkboxes on Widget save state, i18n for widget.
849
+ * Adds excerpt size to widget.
850
+
851
+ = 0.27 =
852
+
853
+ * Fixes to widget.
854
+ * Adds year and month parameters to list posts from a certain year and/or month.
855
+ * Adds search parameter to display posts that match a search term.
856
+
857
+ = 0.26 =
858
+
859
+ * Adds i18n, German and Spanish translations. All credit to [cfoellmann](https://github.com/cfoellmann) for implementing this and writing the German translation. Thanks! :)
860
+
861
+ = 0.25.1 =
862
+
863
+ * Changed excerpt limit, it uses word count, and is working for WordPress' excerpt and auto generated ones.
864
+
865
+ = 0.25 =
866
+
867
+ * Better excerpt
868
+ * Applies title filter, should work with qTranslate
869
+ * Adds post status parameter
870
+ * Adds meta links to plugin page - most importantly: INSTRUCTIONS (please read them).
871
+
872
+ = 0.24 =
873
+
874
+ * Fixes "excerpt doesn't strip shortcodes" - https://github.com/picandocodigo/List-Category-Posts/issues/5
875
+ * Exclude currently displayed post - [1](http://wordpress.stackexchange.com/questions/44895/exclude-current-page-from-list-of-pages/), [2](https://github.com/picandocodigo/List-Category-Posts/pull/8)
876
+ * Add title to category title [1](http://wordpress.stackexchange.com/questions/44467/list-category-plugin-changing-the-links), will be improved.
877
+ * Attempting to condition whitespaces to WordPress Coding Standard (emacs php-mode sucks for this...)
878
+ * No more git-svn crap, now I'm developing this over at (GitHub)[https://github.com/picandocodigo/List-Category-Posts] and copying it into the WordPress SVN Repo.
879
+
880
+ = 0.23.2 =
881
+
882
+ * Bugfix release
883
+
884
+ = 0.23.1 =
885
+
886
+ * Bugfix release
887
+
888
+ = 0.23 =
889
+
890
+ 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
891
+
892
+ * Added excerpt size. You can set how many characters you want the excerpt to display with 'excerpt_size'.
893
+ * Fixed HTML tag and CSS class for each element (Check [Other notes](http://wordpress.org/extend/plugins/list-category-posts/other_notes/) for usage).
894
+ * Removed shortcodes from excerpt.
895
+
896
+ = 0.22.3 =
897
+
898
+ * Fixed thumbnail size parameter, added usage example on README.
899
+ * Added space after author and date http://wordpress.org/support/topic/plugin-list-category-posts-space-required-after
900
+
901
+ = 0.22.2 =
902
+
903
+ * Fixed bug with the categorypage=yes param.
904
+ * Tested with WordPress 3.3.
905
+
906
+ = 0.22.1 =
907
+
908
+ * Fixed accidentally deleted line which made the catlink=yes param not work.
909
+
910
+ = 0.22 =
911
+
912
+ * 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
913
+ * Added *morelink* parameter, check Other notes for usage.
914
+
915
+ = 0.21.2 =
916
+
917
+ * Removed var_dump... (Sorry about that)
918
+
919
+ = 0.21.1 =
920
+
921
+ * Small fixes:
922
+ * Used "empty()" function for some Strings instead of evaluating isset() and != ''.
923
+ * Include parameters on the get_posts args only when they are set (post_parent among others).
924
+
925
+ = 0.21 =
926
+
927
+ * Added 'thumbnail_class' parameter, so you can set a CSS class to the thumbnail and style it.
928
+
929
+ = 0.20.5 =
930
+
931
+ * 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.
932
+ * Now the name parameter accepts multiple categories too. Just use: `[catlist name=category1,category2]`
933
+
934
+ = 0.20.4 =
935
+
936
+ * Yet another bugfix, regarding nothing being displayed when using tags.
937
+
938
+ = 0.20.3 =
939
+
940
+ * Fixed category detection code, which created some messy bugs in some cases
941
+
942
+ = 0.20.2 =
943
+
944
+ * Minor bugfix release
945
+
946
+ = 0.20.1 =
947
+
948
+ * Fixed extra " added to ul tag, thanks ideric (http://wordpress.org/support/topic/plugin-list-category-posts-extra-added-to-ul-tag)
949
+
950
+ = 0.20 =
951
+
952
+ * Added the possibility to list posts from the current post's category
953
+ * Some fixes to documentation
954
+
955
+ = 0.19.3 =
956
+
957
+ * Another taxonomy fix, thanks frisco! http://wordpress.org/support/topic/plugin-list-category-posts-problem-with-custom-taxonomies
958
+
959
+ = 0.19.2 =
960
+
961
+ * Small fix, missing parameter for taxonomy.
962
+
963
+ = 0.19.1 =
964
+
965
+ * Added thumbnail to Widget.
966
+ * Added thumbnail link to post (http://picod.net/33).
967
+
968
+ = 0.19 =
969
+
970
+ 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):
971
+
972
+ * 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
973
+ * Added thumbnail_size parameter.
974
+ * Added support for custom taxonomies and also moved to the array call of get_posts. Coded by wsherliker, thanks! http://picod.net/32
975
+ * Fixed widget, now it remembers saved options.
976
+
977
+ = 0.18.3 =
978
+
979
+ * Small excerpt fix, some readme file fixing too.
980
+ * Not showing the_content for password protected posts.
981
+
982
+ = 0.18.2 =
983
+
984
+ * Small fixes. Should work for name parameter in all cases now.
985
+
986
+ = 0.18.1 =
987
+
988
+ * Added slug and name to the fetching of category id from previous update.
989
+
990
+ = 0.18 =
991
+
992
+ * Fixed category id bug. Reported and fixed by Eric Celeste - http://eric.clst.org, thanks!
993
+ * Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.
994
+ * Added category link which wasn't working after previous big update.
995
+
996
+ = 0.17.1 =
997
+
998
+ * Fixed displaying of "Author:" even when not being called.
999
+
1000
+ = 0.17 =
1001
+
1002
+ * Major rewrite. The whole code was rewritten using objects. It's easier now to develop for List Category Posts.
1003
+ * Both STYLESHEETPATH and TEMPLATEPATH are checked for templates.
1004
+
1005
+ = 0.16.1 =
1006
+
1007
+ * Fixed shortcode nesting.
1008
+
1009
+ = 0.16 =
1010
+
1011
+ * Changed STYLESHEETPATH to TEMPLATEPATH to point to the parent theme.
1012
+ * Added support to display custom fields. (http://picod.net/wp03)
1013
+ * Tested with WordPress 3.1 - http://wordpress.org/support/topic/399754
1014
+
1015
+
1016
+ = 0.15.1 =
1017
+
1018
+ * Fixed a bug with undeclared variable. (Check http://picod.net/walcp, thanks Das!)
1019
+
1020
+ = 0.15 =
1021
+
1022
+ * Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
1023
+
1024
+ = 0.14.1 =
1025
+
1026
+ * 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.
1027
+
1028
+ = 0.14 =
1029
+
1030
+ * Added "post_type" and "post_parent" from the underlining "get_posts()" API to be usable within the short-code. By Martin Crawford, thanks!
1031
+ * 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).
1032
+ * Fixed "tags" parameter on the documentation, it used to say "tag", and the plugin looks for "tags".
1033
+
1034
+ = 0.13.2 =
1035
+
1036
+ * Fixed thumbnail code, added it to default.php template as example.
1037
+
1038
+ = 0.13.1 =
1039
+
1040
+ * Fixed broken dateformat.
1041
+
1042
+ = 0.13 =
1043
+
1044
+ * Show post thumbnails, should be tested, feedback on styling is welcome. Thanks to Sebastian from http://www.avantix.com.ar/
1045
+
1046
+ = 0.12 =
1047
+
1048
+ * Added comments count.
1049
+ * Updated readme file
1050
+
1051
+ = 0.11.2 =
1052
+
1053
+ * Another minimal bug fixed with the excerpt...
1054
+
1055
+ = 0.11.1 =
1056
+
1057
+ * Fixed small bug which made the excerpt show up everytime... (Sorry :S)
1058
+
1059
+ = 0.11 =
1060
+
1061
+ * Automatic excerpt added in case the user didn't specifically write an excerpt.
1062
+ * Widget has been finally fixed. The attributes finally save themselves, and the widget works as expected :D
1063
+
1064
+
1065
+ = 0.10.1 =
1066
+ * Small fix -
1067
+ added ul tags to default template.
1068
+ * Compatible WordPress 3.0 with Twenty Ten theme (thanks again Doug Joseph :) )
1069
+
1070
+ = 0.10 =
1071
+
1072
+ * Code for the_content was fixed so that the content to output filtered content (thanks DougJoseph http://wordpress.org/support/topic/399754)
1073
+
1074
+ = 0.9 =
1075
+
1076
+ * admin parameter now shows "display name" instead of "user nice name".
1077
+ * 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)
1078
+ * Added tag support
1079
+
1080
+ = 0.8.1 =
1081
+
1082
+ * Fixed bug for 'content'.
1083
+ * There's new stuff on the widget options. I'm still working on it, so some bugs may appear.
1084
+
1085
+ = 0.8 =
1086
+
1087
+ * 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.
1088
+ * Updated readme file.
1089
+
1090
+ = 0.7.2 =
1091
+
1092
+ * Fixed link to category.
1093
+ * Improved template system.
1094
+
1095
+ = 0.7.1 =
1096
+
1097
+ * Fixed uber stupid bug with offset... Sorry about that!
1098
+
1099
+ = 0.7 =
1100
+
1101
+ * Exclude posts. Contribution by acub.
1102
+ * Offset parameter on shortcode to start listing posts with an offset. Contribution by Levi Vasquez
1103
+ * Content of the post can now be displayed. Contribution by Lang Zerner.
1104
+ * Link to the category available. By request on the plugin's forum.
1105
+ * Fixed small bug when using category name.
1106
+
1107
+ = 0.6 =
1108
+
1109
+ * Minor fix for unclosed ul if not using templates.
1110
+ * Added option to list posts from many categories at once.
1111
+ * Added option to exclude categories.
1112
+
1113
+ = 0.5 =
1114
+
1115
+ * Readme.txt validation.
1116
+ * Added 'excerpt' parameter. You can now show the excerpt for each post.
1117
+ * Added 'dateformat' parameter. Format of the date output. Default is get_option('date_format') - by Verex
1118
+ * Added 'template' parameter. Now you can choose template for output of the plugin. File name of template from templates directory without extension. Example: For 'template.php' value is only 'template'. Default is 'default' that means template in code of plugin not in template file -by Verex
1119
+
1120
+ = 0.4.1 =
1121
+
1122
+ * Fixed some code to enable PHP 4 compatibility. Shouldn't hosting services update to PHP 5?
1123
+
1124
+ = 0.4 =
1125
+
1126
+ * Added 'date' parameter. Now you can show the post's date when listed.
1127
+ * Added 'author' parameter. You can also show the post's author.
1128
+ * Sidebar Widget now allows you to add a title in h2 tags.
1129
+ * Changed some variable names, to keep better compatibility with other plugins/wordpress variables.
1130
+ * Tested with Wordpress 2.7.
1131
+
1132
+ = 0.3 =
1133
+
1134
+ * Broke backwards compatibility. Users of version 0.1 should update their pages and posts for the new shortcode formatting.
1135
+ * Option to pass arguments to the plugin, in order to use name of category instead of ID, orderby, order and number of posts are passed through parameters.
1136
+
1137
+ = 0.2 =
1138
+
1139
+ * Added experimental sidebar widget (use at your own risk, not ready for prime-time yet since it hasn't been tested :P )
1140
+
1141
+ = 0.1.1 =
1142
+
1143
+ * Fixed major bug, which gave 404 error when trying to use "Options" page.
1144
+
1145
+ = 0.1 =
1146
+
1147
+ * Option page to limit number of posts.
1148
+ * Working using [category=ID] for posts and pages, with several categories support.