[Resolved] Using BOP plugin for search in Nav menu

Home Forums Support [Resolved] Using BOP plugin for search in Nav menu

Home Forums Support Using BOP plugin for search in Nav menu

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #289427
    CRISTO

    I mentioned earlier how easy this was to install on my site. One problem I found was that sometimes the first resut shown after a search was not valid…it took you to a “page not found”. After asking the plug-in author, he suggested that there was a conflict with Envira Gallery that was causing this. His advice was to add this to the php files:

    // Change search function globally to search only post, page and portfolio post types
    function prefix_limit_post_types_in_search( $query ) {
    if ( $query->is_search ) {
    $query->set( ‘post_type’, array( ‘post’,’page’, ‘portfolio’ ) );
    }
    return $query;
    }
    add_filter( ‘pre_get_posts’, ‘prefix_limit_post_types_in_search’ );

    I used the “Code Snippets” plug-in someone here had suggested and it worked like a charm. Not a GP related problem, but just in case anyone has the same situation, this is a solution.

    #289481
    Tom
    Lead Developer
    Lead Developer

    Awesome, thanks for sharing! 🙂

    #289484
    CRISTO

    Thanks to whoever mentioned “code snippets” plug-in as well…..it was super easy.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.