Okay
  Public Ticket #2045099
Search box
Closed

Comments

  • Sherry started the conversation

    Hi there,

    this is a temporary domain.

    I installed Ivory search plugin, and tried many kinds of trouble shooting, never succeed to search the portfolio article.

    May I know is there any suitable search plugin for New Wave theme.

    appreciate the help, thanks


  •  1,973
    Support replied

    Hello Sherry,

    We have not tested or integrated the theme with any of the search plugins but try opening functions.php file and remove this bit:

    if( !function_exists('searchfilter') ){

    function searchfilter($query) {

    if ($query->is_search && !is_admin() ) {

    $query->set('post_type',array('post'));

    }
    return $query;

    }
    add_filter('pre_get_posts','searchfilter');

    }


    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  • Sherry replied

    Hi

    Thanks for the suggestion, though it's still not working?

    thus I'm wondering if the search function was only for blog article?  

    and there's no "not found page" 

    I do need the search function working for portfolio post, wanna know if there's any solution. thank you

  •  1,973
    Support replied

    Hi Sherry

    try this solution

    https://wp-snippet.com/snippets/include-specific-custom-post-types-wordpress-search-results/

    following this suggestion your code would look like


    if( !function_exists('searchfilter') ){

       function searchfilter($query) {

          if ($query->is_search && !is_admin() ) {

               $query->set('post_type',array('post', 'newave_portfolio'));

          }

          return $query;

       }
       add_filter('pre_get_posts','searchfilter');

    }


    just replace the old code from functions.php

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy