S
S
s94paeta2014-01-26 22:16:32
Online shopping
s94paeta, 2014-01-26 22:16:32

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

2 answer(s)
A
Alexander Tokmakov, 2014-01-27
@calliko

Campaign cant in the subject. You need to print the error display E_ALL

V
Vasya Kaminskaya, 2015-08-23
@evans192

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;
}
}

As you can see, there is a line in the code:
Copy it to the top of functions.php and change add to remove and voila!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question