jermartin77
Member
Posted 2 years ago #
Hello,
I am looking at modifying my archive page to display content if the user is in a specific category.
so I would like to do something like:
if($_GET['cat'] == 'foo'){
echo 'content specific to this category';
}
I just cannot find the name of the parameter for category.
Try:
<?php if(is_category'foo')) :?>
[ specific content ]
<?php else :?>
[ general content ]
<?php endif;?>
jermartin77
Member
Posted 2 years ago #
where "foo" would be the category id or slug?
jermartin77
Member
Posted 2 years ago #
Thanks that is much better than going after the actual parameter
Sorry. "foo" can be a category title, slug or id (if I remember correctly.)
mercuryfenix
Member
Posted 2 years ago #