wp_dropdown_categories in a template file
-
Hello, I have been researching and trying things for days and the closest thing to a concensus I get as far as how to do this is to use this code. I’ve created a dropdown list of categories with links to those category pages. The drop down appears (on this page: ) but it should be excluding the categories 0,9,12,43. They still show. Interestingly, I can sort the categories in ascending or descending order and that responds but no the category exclusion.
I also would like to show Select Category as a non-linked label at the top of the list and am not sure how to do this. Any help would be much appreciated! My eyeballs are fried!
<?php wp_dropdown_categories ($args = array ( 'show_option_all' => '', 'show_option_none' => '', 'orderby' => 'ID', 'order' => 'ASC', 'show_count' => 0, 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '0,9,12,43', 'echo' => 1, 'selected' => 0, 'hierarchical' => 0, 'name' => 'cat', 'id' => '', 'class' => 'postform', 'depth' => 0, 'tab_index' => 0, 'taxonomy' => 'category', 'hide_if_empty' => '',) ); ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘wp_dropdown_categories in a template file’ is closed to new replies.