Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

How to redirect to custom search result page? (3 posts)

Started 8 months ago by: imjscn

  • Profile picture of imjscn imjscn said 8 months ago:

    I replace bp header search form with google search form (name = ‘q’ ) , then added this code:
    function bp_google_action_search_site(){
    global $bp;
    if ( bp_is_current_component( bp_get_search_slug() ) )
    bp_core_load_template( apply_filters( 'bp_core_template_search_template', 'search-google' ) );
    }
    remove_action( 'bp_init', 'bp_core_action_search_site', 5 );
    add_action( 'bp_init', 'bp_google_action_search_site', 10 );

    The search action get redirected to homepage.
    How to redirect the search result page?

  • Profile picture of ankurm ankurm said 8 months ago:

    did you create a search.php file?

  • Profile picture of wedeem wedeem said 8 months ago:

    Try using esc_url

    On my mobile so can’t test it.