/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if(is_category()) { $cat = get_query_var('cat'); $yourcat = get_category($cat); echo "the slug is" . $yourcat->slug; }
URL: http://www.bestwpthemez.com/wordpress/code-to-get-current-category-slug-in-wordpress-blog-1434/