[Resolved] how to echo category id outside of the loop
i want to display the category id of the current category outside of the loop. i tried it with
<?php $thecatid = get_cat_ID( $cat_name ) ; echo $thecatid; ?>but it only returns me a ‘0’.
i found a working solution in the forums
get_cat_id( single_cat_title("",false) )but i’m not sure if this is really a “clean” solution.
- The topic ‘[Resolved] how to echo category id outside of the loop’ is closed to new replies.