ozgression
Member
Posted 4 years ago #
Hi, is there a way to output the category ID in the Archive template? This will need to be done outside the loop.
For example: Uncategorized's category ID is 1. I want to display in the Acrhive template, when viewing the Uncategorized category something like...
Category Number: 1
Can someone help me with this?
Cheers...
ozgression
Member
Posted 4 years ago #
Thanks.
My php skills are a bit limited. How do I actually use:
get_query_var('cat');
to display the number on the page?
<?php echo get_query_var('cat'); ?>
on a category page, that will echo back the id
is there a way that I can use get_query_var('cat'); to pass the current category ID to wp_list_cats in order to display only children of the current category?