Forums Forums Search & Filter Pro Using default WP search bar to show S&F results page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Trevor
    #243811

    In your child theme functions.php file* you would have a function like this:

    function sandf_change_search_url_rewrite() {
    	if ( is_search() && ! empty( $_GET['s'] ) ) {
    		wp_redirect( home_url( "search-results/?_sf_s=" ) . urlencode( get_query_var( 's' ) ) );
    		exit();
    	}	
    }
    add_action( 'template_redirect', 'sandf_change_search_url_rewrite' );

    * Note on child theme. Normally, one should work with a child theme (it is what WordPress recommends). If you are not, then make one using the Orbisius plugin that will do it for you. Simply accept the default settings and it will make and activate it for you, then you can remove that plugin. It should not change anything about your site.

    Modified files (such as the functions.php file) should always be kept in the child theme folder.

    Anonymous
    #243967

    Thanks a lot – worked great!

    Regards

    Trevor
    #243969

    Thanks for letting me know. I will close this thread for now.

Viewing 3 posts - 1 through 3 (of 3 total)