Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ajay

    (@ajay)

    Hi, there isn’t an easy way to do it currently. You could achieve this by editting the better-search.php file slightly.

    Are you using Seamless integration mode? If not, after line 85 of better-search.php, you can add:

    if ( 'qa_faqs' == get_post_type() ) {
    	    return;
    }

    Please note that I have not tested this code.

    Thread Starter dahlskebank

    (@dahlskebank)

    Thanks! Swift reply! ??

    That does work perfectly when it is not seamless integration mode.

    I prefer seamless integration mode, so I won’t have to redesign the whole search results template.

    Possible solution for seamless integration mode?

    Plugin Author Ajay

    (@ajay)

    Yes. You can add this code in the function bsearch_where_clause before line 951

    if ( 'qa_faqs' == get_post_type() ) {
    	    return $where;
    }

    And bsearch_orderby_clause before line 971

    if ( 'qa_faqs' == get_post_type() ) {
    	    return $orderby;
    }
    Thread Starter dahlskebank

    (@dahlskebank)

    Not getting that to work though. ??

    Removed the code added after line 85.No change. Added only code before line 951. No change. Added only code before line 971. No change.

    This worked however.

    bsearch_where_clause before line 951

    $post_type = get_query_var('post_type');
    	if( $wp_query->is_search && $post_type == 'qa_faqs' ) {
    		return $where;
    	}

    bsearch_orderby_clause before line 971

    $post_type = get_query_var('post_type');
    	if( $wp_query->is_search && $post_type == 'qa_faqs' ) {
    		return $orderby;
    	}

    Plugin Author Ajay

    (@ajay)

    Thanks for confirming and figuring it out!

    I think the code you used above should also work for the non-seamless mode.

    i.e.

    $post_type = get_query_var('post_type');
    if( $post_type == 'qa_faqs' ) {
    		return;
    }

    Thread Starter dahlskebank

    (@dahlskebank)

    Well, thank you for making the plugin! ??

    Plugin Author Ajay

    (@ajay)

    You’re welcome and thank you for a 5-star review.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable Better Sarch on certain search forms’ is closed to new replies.