I know that
<ul> <?php wp_list_categories('orderby=name&exclude=3,5,9,16'); ?> </ul>
Can be used to hide certain categories. However, this assumes I know their ID’s.
If I have a theme and I ask my client to make a category called ‘headlines’ and want that category to be excluded how can I do that if I don’t know the ID?
a lot of people use custom theme options and ask the user to input the categories they want to exclude here. sorry i cant be any more help i’m no wordpress guru
- Exclusive Author
- Has been a member for 3-4 years
- Won a Competition
- Sold between 100 000 and 250 000 dollars
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Author was Featured
- Bought between 10 and 49 items
- Referred between 10 and 49 users
<?php $hideId = get_cat_ID( "headlines" ); wp_list_categories('orderby=name&exclude=' . $hideId . ''); ?>
I’m using this in my navigation:
and this in my control panel, the user inputs the ID’s of Categories and Pages they want to exclude.
array( "name" => "Navigation Exclude", "desc" => "Enter a Category or Page ID (separate multiple by commas) to remove them from the navigation", "id" => $shortname."_nav_exclude", "type" => "text", "std" => ""),