List category posts - Version 0.46.4

Version Description

  • Finally (hopefully) fix the excerpt issues.
Download this release

Release Info

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

Code changes from version 0.46.3 to 0.46.4

include/CatList.php CHANGED
@@ -439,27 +439,29 @@ class CatList{
439
 
440
  public function get_excerpt($single){
441
  if ( !empty($this->params['excerpt']) && $this->params['excerpt']=='yes'){
442
- switch($single->post_excerpt){
443
 
444
- case(null):
 
445
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
446
- default:
447
  if(!empty($this->params['excerpt_overwrite']) &&
448
  $this->params['excerpt_overwrite'] == 'yes'){
 
449
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
450
  } else {
 
451
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_excerpt);
452
  }
453
  }
454
 
455
- if( strlen($single->post_content) < 1 ){
456
  $lcp_excerpt = $single->post_title;
457
  }
458
  return $lcp_excerpt;
459
  }
460
  }
461
-
462
- private function lcp_trim_excerpt($text = ''){
463
  $excerpt_length = intval($this->params['excerpt_size']);
464
 
465
  $text = strip_shortcodes($text);
439
 
440
  public function get_excerpt($single){
441
  if ( !empty($this->params['excerpt']) && $this->params['excerpt']=='yes'){
 
442
 
443
+ if($single->post_excerpt == ("")){
444
+ //No excerpt, generate one:
445
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
446
+ }else{
447
  if(!empty($this->params['excerpt_overwrite']) &&
448
  $this->params['excerpt_overwrite'] == 'yes'){
449
+ // Excerpt but we want to overwrite it:";
450
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
451
  } else {
452
+ // Bring post excerpt;
453
  $lcp_excerpt = $this->lcp_trim_excerpt($single->post_excerpt);
454
  }
455
  }
456
 
457
+ if( strlen($lcp_excerpt) < 1 ){
458
  $lcp_excerpt = $single->post_title;
459
  }
460
  return $lcp_excerpt;
461
  }
462
  }
463
+
464
+ private function lcp_trim_excerpt($text = ''){
465
  $excerpt_length = intval($this->params['excerpt_size']);
466
 
467
  $text = strip_shortcodes($text);
list_cat_posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.46.3
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.46.4
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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: 3.8.1
7
- Stable tag: 0.46.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -350,55 +350,8 @@ You can have as many different templates as you want, and use them in different
350
 
351
 
352
  * **FAQ**
 
353
 
354
- **Does not work on servers with PHP < 5**
355
-
356
- This is true since version 0.18. If you're still using PHP 4 on your webhost, you should consider upgrading to PHP 5. WordPress 3.1 was the last version to support PHP 4, from 3.2 and forward, only PHP 5 is supported. You can still [download an older version of the plugin](https://wordpress.org/extend/plugins/list-category-posts/download/ "download an older version of the plugin") if you're using PHP 4.
357
-
358
- **Plugin could not be activated because it triggered a fatal error.**
359
-
360
- *Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /.../wp-content/plugins/list-category-posts/include/CatListDisplayer.php on line 10*
361
-
362
- Please check:
363
- http://wordpress.stackexchange.com/questions/9338/list-category-posts-plugin-upgrade-fails-fatal-error/9340#9340
364
-
365
- **How do I display the Thumbnail next to the title?**
366
-
367
- To see the thumbnail next to the title, you can add a class to it like
368
- this:
369
-
370
- `[catlist id=1 thumbnail=yes thumbnail_class=lcp_thumbnail]`
371
-
372
- Then in your theme's stylesheet add this code:
373
-
374
- `.lcp_thumbnail{
375
- float: left;
376
- }
377
-
378
- .lcp_catlist li{
379
- clear: both;
380
- }`
381
-
382
- If you want the thumbnail to the right, just change the `float: left`
383
- attribute to `float: right`.
384
-
385
-
386
- **How to not display the title**
387
-
388
- You have to add a CSS class to the title with the `title_class` parameter. Then edit the title_class class in your theme's CSS file. Something like this:
389
-
390
- In the post:
391
- `[catlist id=3 title_class=lcp_title numberposts=1]`
392
-
393
- And in your theme's CSS:
394
-
395
- `.lcp_title{
396
- display: none;
397
- }`
398
-
399
- **How to insert the shortcode on the theme and not a post or page**
400
-
401
- `<?php echo do_shortcode("[catlist id=3]"); ?>`
402
 
403
  == Upgrade Notice ==
404
 
@@ -433,6 +386,9 @@ Template system has changed. Custom templates should be stored in WordPress them
433
 
434
  == Changelog ==
435
 
 
 
 
436
  = 0.46.3 =
437
  * Fix something that I broke on previous update for excerpt :S
438
 
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: 3.9
7
+ Stable tag: 0.46.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
350
 
351
 
352
  * **FAQ**
353
+ You can find the Frequently Asked Questions [here](https://github.com/picandocodigo/List-Category-Posts/blob/master/doc/FAQ.md#frequently-asked-questions).
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
 
356
  == Upgrade Notice ==
357
 
386
 
387
  == Changelog ==
388
 
389
+ = 0.46.4 =
390
+ * Finally (hopefully) fix the excerpt issues.
391
+
392
  = 0.46.3 =
393
  * Fix something that I broke on previous update for excerpt :S
394
 
templates/default.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Plugin Name: List Category Posts - Template
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: Template file for List Category Post Plugin for Wordpress which is used by plugin by argument template=value.php
6
  Version: 0.9
1
  <?php
2
  /*
3
+ Plugin Name: List Category Posts - Template "Default"
4
  Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
5
  Description: Template file for List Category Post Plugin for Wordpress which is used by plugin by argument template=value.php
6
  Version: 0.9