Skip to main content
edited tags
Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459
Source Link

wp_dropdown_categories() searching is not working with CPT, please review my code

Searching is not working with CPT with custom taxonomy

<form id="searchform" method="get" action="<?php bloginfo('url'); ?>">
        <input type="text" name="s" id="s" size="15" />
        <?php //wp_dropdown_categories('show_option_none=Select category&taxonomy=type'); ?>
        <?php wp_dropdown_categories('depth=0&orderby=name&hide_empty=1&show_option_all=Search Everything&name=course&taxonomy=type'); ?>
        <input type="submit" value="Search" />
    </form>

But with default post and category is working with this code

<form id="searchform" method="get" action="<?php bloginfo('url'); ?>">
    <input type="text" name="s" id="s" size="15" />
    <?php //wp_dropdown_categories('show_option_none=Select category&taxonomy=type'); ?>
    <?php wp_dropdown_categories('depth=0&orderby=name&hide_empty=1&show_option_all=Search Everything'); ?>
    <input type="submit" value="Search" />