First, put the following function in your functions.php file:
function get_cat_slug($cat_id) {$cat_id = (int) $cat_id;$category = &get_category($cat_id);return $category->slug;}Once done, you can call the function as shown below:
This will display the slug for the category with the ID 3.
Thanks to Ken Rosaka for the tip!
View the original article here
This post was made using the Auto Blogging Software from WebMagnates.org This line will not appear when posts are made after activating the software to full version.
0 comments:
Post a Comment