So, to get the category id from a category slug, I use:
<?php
$idObj = get_category_by_slug('blog');
$id = $idObj->term_id;
?>
and to exclude a category:
<?php wp_list_categories('exclude=111'); ?>
But how do I substitute the variable for 111?
So, to get the category id from a category slug, I use:
<?php
$idObj = get_category_by_slug('blog');
$id = $idObj->term_id;
?>
and to exclude a category:
<?php wp_list_categories('exclude=111'); ?>
But how do I substitute the variable for 111?
<?php wp_list_categories('exclude='.$id); ?>Thanks!
This topic has been closed to new replies.