Hey,
Is there any way to get the category (id or slug) that's requested from wordpress?
I mean, if I'm watching http://www....../category/animals, is there any way to return "animals" in php? (I want to use it for a special wp_query).
Thanks,
Hey,
Is there any way to get the category (id or slug) that's requested from wordpress?
I mean, if I'm watching http://www....../category/animals, is there any way to return "animals" in php? (I want to use it for a special wp_query).
Thanks,
in the archive template (category.php or archive.php):
<?php $cat_id = get_query_var('cat');
$cat_slug = get_category($cat_id)->slug; ?>
untested
Thanks a lot, it worked fine.
This topic has been closed to new replies.