• Hi Guys,

    I have the following custom search form setup in searchform.php. This displays the form how i want it too, but when running a search I am getting a 404 Page not found on the results.

    Here is the form

    <form role="search" method="get" action="<?php echo home_url( '/' ); ?>" role="search">
    <?php
    wp_dropdown_categories(
    	array(
    		'show_option_all'    => 'Select Business Type...',
    		'name' => 'business-type',
    		'taxonomy' => 'business-type',
    		'orderby'            => 'NAME',
    		'order'              => 'ASC'
    		)
    	);
    
    wp_dropdown_categories(
    	array(
    		'show_option_all'    => 'Select County...',
    		'name' => 'county',
    		'taxonomy' => 'county',
    		'orderby'            => 'NAME',
    		'order'              => 'ASC'
    		)
    	);
    ?>
    
    <input type="submit" id="searchsubmit" class="rtd-btn" value="<?php echo esc_attr_x( 'Search', 'submit button' ); ?>" />
    <input type="hidden" name="post_type" value="featured-business" />
    <input type="hidden" name="post_type" value="business" />
    </form>

    And this is the url generated when running a search. This is bring up a 404 error.

    http://www.mydomain.com/?business-type=40&county=14&post_type=featured-business&post_type=business

    Can anybody shed any light on how to resolve this? I would like it to use my search.php template when displaying the results and obviously something needs to change in the permalinks i’m guessing to allow this to output.

    I was using a plugin called cat&tag filter, which allowed me to add ‘ add_search_param=”1″ ‘ to the shortcode which seemed to do the job. But as I now need to do this coding manually rather than a plugin i’m not sure how I can add this kind of functionality to my searchform.

    Any help would be greatly appreciated.

    Thanks

    Dan

  • The topic ‘Permalink issue on custom search form’ is closed to new replies.