phpMoot
phpMoot > PHP - Examples > PHP – WordPress – Get Category Slug
Author: phpMoot July 16, 2013
PHP - Examples
This following PHP example helps you to get the current category slug in WordPress.
Code Example:
<?php if(is_category()) { $cat = get_query_var('cat'); $yourcat = get_category($cat); echo "the slug is" . $yourcat->slug; } ?>
← Previous post
Next post →