diff --git a/include/CatList.php b/include/CatList.php index 98a6543..237d5ff 100644 --- a/include/CatList.php +++ b/include/CatList.php @@ -56,8 +56,14 @@ private function lcp_set_categories(){ * by Eric Celeste / http://eric.clst.org */ private function get_category_id_by_name($cat_name){ + //We check if the name gets the category id, if not, we check the slug. + $term = get_term_by('name', $cat_name, 'category'); + + if (!$term): $term = get_term_by('name', $cat_name, 'category'); - return $term->term_id; + endif; + + return $term->term_id; } public function get_category_id(){ diff --git a/list_cat_posts.php b/list_cat_posts.php index a364cf9..06131bd 100644 --- a/list_cat_posts.php +++ b/list_cat_posts.php @@ -3,7 +3,7 @@ Plugin Name: List category posts Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/ 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]. -Version: 0.18 +Version: 0.18.1 Author: Fernando Briano Author URI: http://picandocodigo.net/ */ diff --git a/readme.txt b/readme.txt index 26e45d2..b34baf8 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts Tags: list, categories, posts, cms Requires at least: 2.8 Tested up to: 3.1 -Stable tag: 0.18 +Stable tag: 0.18.1 == Description == List Category Posts is a simple WordPress plugin which 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. @@ -137,6 +137,9 @@ Template system has changed. Custom templates should be stored in WordPress them == Changelog == += 0.18.1 = +* Added slug and name to the fetching of category id from previous update. + = 0.18 = * Fixed category id bug. Reported and fixed by Eric Celeste / http://eric.clst.org, thanks! * Improved template system a liitle bit, now you can pass an HTML tag and a CSS class to sorround each field on your template.