• Resolved scottoliphant

    (@scottoliphant)


    So, trying to exclude categories from wp_list_categories by name, not ID. I know this isn’t currently possible, is there a workaround to introduce an exclude function into the results? One thought I had was to get the category list, then filter out the name at render time, but that wouldn’t kill the sub cats as well. thanks in advance!
    scott

Viewing 1 replies (of 1 total)
  • Thread Starter scottoliphant

    (@scottoliphant)

    found a solution

    <?php // get category name's ID then insert into wp_list_categories ?>
    <?php $category = get_category_by_slug('Archive');
    $catid = $category->term_id; ?>
    <ul>
    <?php wp_list_categories('exclude='.$catid); ?>
    </ul>

Viewing 1 replies (of 1 total)

The topic ‘wp_list_category exclude by name’ is closed to new replies.