Posted By

dsheetz on 07/24/09


Tagged

php wordpress category slug tag


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

lilumi
umang_nine
kingkool68


Wordpress Get Category Slug


 / Published in: PHP
 

URL: http://www.bestwpthemez.com/wordpress/code-to-get-current-category-slug-in-wordpress-blog-1434/

  1. if(is_category()) {
  2. $cat = get_query_var('cat');
  3. $yourcat = get_category($cat);
  4. echo "the slug is" . $yourcat->slug;
  5. }

Report this snippet  

You need to login to post a comment.