Hi Guys, is it possible to know what's the first category queried in a wordpress URL?
Example:
http://www.mywebsite.com/category/mycat/mysubcat/
My Categories hierarchy is Something Like
Parent Cat 1
Parent Cat 2
Parent Cat 3
Subcat 1
Subcat 2
Subcat 3
Parent Cat 4
Subcat 1
Subcat 2
Subcat 3
What i'm trying to do is to echo the "mycat" value in archive.php, to do a conditional similar to:
if($value =="mycat") { ... } else { ... }
Why it's a little bit complicated? because each post belongs to at least 1 sub-cat from each parent plus 1 of the parent category with no childs.
I need something similar to $cat = get_query_var('cat'); (in this case $cat returns mysubcat)
Any Ideas?
Thanks so much!!