• Resolved timsainb

    (@timsainb)


    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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude Category Slug From wp_list_categories’ is closed to new replies.