Forums › Forums › Search & Filter Pro › General search function not working
Tagged: general search
- This topic has 13 replies, 2 voices, and was last updated 6 years, 8 months ago by Anonymous.
-
Anonymous(Private) February 5, 2018 at 12:11 pm #157375
Hi Trevor,
Thanks for the quick response.
I can get it to half work… This search query should yield the response:
“Search Results for: green Brexit, Legatum Institute, Posts”
http://smartthinking.staging.wpengine.com/?sfid=979&_sf_s=green&_sft_category=brexit&_sfm_think_tank=Legatum%20Institute&post_types=post#aAt least that is what I would like it to do. But currently only the category is showing.
This is the markup:
<?php global $searchandfilter; $sf_current_query = $searchandfilter->get(979)->current_query(); ?> <h1 class="archive_title"><span><?php _e("Search Results for","wpbootstrap"); ?>:</span> <?php echo esc_attr(get_search_query()); ?> <?php $args = array( "str" => '%2$s', "delim" => array(", ", " - "), "field_delim" => ', ', "show_all_if_empty" => false ); echo $sf_current_query->get_fields_html( array("_sft_category", "_sft_post_tag", "_sft_sfdc_post_type", "_sft_sfdc_think_tank"), $args ); ?> </h1>
Have I done something wrong?
Thanks,
AlexTrevor(Private) February 5, 2018 at 12:27 pm #157381You might need this for what is in the search box:
$search_words=$sf_current_query->get_search_term();
and then echo that. If you search our forum:
https://support.searchandfilter.com/forums/search/sf_current_query/
You will see many different examples of use.
Anonymous(Private) February 27, 2018 at 1:04 pm #162430Hi Trevor,
I didn’t quite manage to get that working in the end… but I have a separate question, hopefully more straightforward.
Is there a setting to make the general search look in the tags?
I.e, if I tag a post with ‘digital’, but there is no mention of the word in the title or content, but then if I search for the word ‘digital’ in the general search box, I’d like that post to show.
?Thanks,
Alex -
AuthorPosts