Search fails when using the radio buttons
Search fails when using the radio buttons
Search fails when using the radio buttons
This would help you to fetch a single post from a specific category. $args = array(‘post_type’ => ‘post’, ‘posts_per_page’=> 1, ‘cat’ => get_cat_ID(‘Category Name’));
Okay. I solved it by myself. i dunno what’s wrong, but it looks like using first case – just doesn’t work. using second case – is a bad idea. so i began to work with sql and posts_where commands. first: instead of $wp_query->query_vars[‘s’] i started to use get_search_query() second: looks like when sql tries to … Read more
Custom fields are stored in post metadata, which is very expensive (slow) to query. Ideally, you would be better off re-coding the site to use custom taxonomies instead of custom fields. From there, search would be easier. If you stick with ACF or other metadata, you can customize the search form and queries, but you’ll … Read more
multiple string replace of post’s content for large data
Problem was that I had a plugin installed that deals with the searches, it’s called Better Search. function query_1($query){ $query .= “,wp_postmeta.meta_value as total_saless “; return $query; } add_filter( ‘bsearch_posts_match_field’, ‘query_1′ ); function query_2($query){ $query .= “AND wp_postmeta.meta_key=’total_sales’ “; return $query; } add_filter( ‘bsearch_posts_where’, ‘query_2’ ); function query_3($query){ $query = ” CAST(total_saless AS INTEGER) > … Read more
Search has query that will return no results
This works the same way Google etc work, to search for an exact phrase, wrap it in quotes e.g. online books vs “online books”
I assume you have posts with custom fields that have your select fields values as values for these custom fields, in this case you should take a closer look in ‘Custom Fields Paramenters’ from the WP_Query class references at: https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters doing so you can just compare you select fields values with your post custom fields … Read more
I’d suggest prohibiting spam users first. But above all, I’m not aware about the performance of the Search Meter plugin. Using free tool like Google Analytics or StatCounter you can verify the searches really occurred or not. Workaround As you have the exact timestamp when the search occurred you can also get the user’s identity, … Read more