• I’ve created a PHP snippet to load a search form into the header of all site pages. If I hit the search button without having anything typed in it redirects to the page listing posts. I’ve got my site set up as pages with a news page showing category posts (all posts are the same category). This problem happens with Responsive and Thematic themes,maybe others. Here’s the PHP snippet placed in the functions.php file of my child theme for Responsive

    // add search form to the header - inside the branding div
    //
    
    function childtheme_searchform(){
    	get_search_form();
    }
    add_action('responsive_in_header','childtheme_searchform');

    I’ve got this site running local. For working example go to houstonmidtown.com and use their search on the home page

  • The topic ‘Blank search redirects to post page’ is closed to new replies.