I'm trying to edit a wordpress theme.

The following is the section of code where the list of categories is retrieved and displayed in a drop-down menu.

<p>
<label for="entrycat">* <?php _e( "Question category:", "sofa_qanda" ); ?></label>
<?php
$select = wp_dropdown_categories( 'show_option_none=Select&show_count=0&orderby=name&echo=0&hide_empty=0' );
$select = preg_replace( '|<select(.*?).*?>|i', '<select id="entrycat" name="entrycat" tabindex="4">', $select );
echo $select;
?>
</p>

I what to exclude a particular category, say category id 10 from the list. How do I do that?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

http://codex.wordpress.org/Function_Reference/wp_dropdown_categories

use the 'exclude' parameter; example:

$select = wp_dropdown_categories( 'show_option_none=Select&show_count=0&orderby=name&echo=0&hide_empty=0&exclude=10' ); 
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.