Support » Fixing WordPress » Advanced Search Form – Post Types Dropdown

  • Hello, I am working on a site where I am trying to build an advanced search form and so far it’s coming along good except I am having a problem with creating a drop down for post type selection. This is my form code so far (I removed all my divs to simplify it)

    <form method="get" id="searchform" name="searchform" action="<?php echo home_url(); ?>/">
    <select name="posttype">
    		<option name="product" value="product">Legal Documents</option>
    		<option name="videos" value="videos">Legal Advice - Videos</option>
    <option value="link">Legal Advice - Links</option>
    <option value="text">Legal Advice - Articles</option>
    		 <option value="post_type_c">An Attorney</option>
    <input name="s" id="s" class="s" type="text" onfocus="if(this.value=='<?php _e('');?>') this.value='';" onblur="if(this.value=='') this.value='<?php _e('');?>';" value="<?php _e('');?>" />
    <button tabindex="2" type="submit" class="search_btn">
    <?php wp_dropdown_categories( 'taxonomy=videoscategory&show_option_all=All Practice Areas' ); ?>
    <?php wp_dropdown_categories( 'taxonomy=states&show_option_all=All U.S States' ); ?>

    The drop down categories are working as should, but the drop down for the post types are not working at all. This is the URL structure returned –

    I’ve also tried –

    But neither seem to be working. How can I fix this? Any help is appreciated. Thanks.

  • The topic ‘Advanced Search Form – Post Types Dropdown’ is closed to new replies.