This is a question I’ve allready asked but then it followed another question which was resolved so I thought of opening a fresh new thread dedicated to this particular question which was’nt resolved :)):
(I’ll also try to extract the question to it’s essence, so it’d be clearer)
(now for the problem:)
In the category archive page, I want to display it’s category ID as the title. I used this code for that:
<?php the_category_ID(); ?>
but then if the most recent post is belonged to a child category then the ID would be the child’s ID.
then I tried this way:
$cat = single_cat_title(); echo $cat->cat_ID;
but this time it insisted to display the category name, although I wrote
Can anyone help me with that?
- The topic ‘How to display the category ID for a category archive?’ is closed to new replies.