Answer the question
In order to leave comments, you need to log in
How to set up a site search template in Wordpress?
I can't set up search on the site. I installed one template and set it up, but when it came to the search, the search did not find the product on the site. At first I thought that the search plugin was somehow different, but then I installed another template and the search works fine ... How to configure the first template so that the search works in it?
Site on Wordpress.
Link: http://librops.ru, try to enter the name of the book in the search.
Answer the question
In order to leave comments, you need to log in
Campaign cant in the subject. You need to print the error display E_ALL
I have the same problem. Avada theme, only searches for posts and pages. Solution in 3 seconds:
Here is the filter code in my theme (in functions.php) that restricted the search:
if ( ! is_admin() ) {
add_filter( 'pre_get_posts', 'avada_SearchFilter' );
function avada_SearchFilter( $query ) {
if ( is_search() && $query->is_search ) {
if ( isset( $_GET ) && 1 < count( $_GET ) ) {
return $query;
}
if ( 'Only Posts' == Avada()->settings->get( 'search_content' ) ) {
$query->set('post_type', 'post');
} elseif ( 'Only Pages' == Avada()->settings->get( 'search_content' ) ) {
$query->set('post_type', 'page');
}
}
return $query;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question