Tagged: search
-
AuthorPosts
-
May 4, 2017 at 1:19 am #787503
Hi there!
Is there a snippet to include specific custom fields into the AJAX search?
Thanks!
May 4, 2017 at 6:31 pm #787995Hey blafoley,
No, our search handles just one parameter.
You might want to consider using a plugin for that. Here is some reading on the topic http://www.wpbeginner.com/showcase/12-wordpress-search-plugins-to-improve-your-site-search/If you need further assistance please let us know.
Best regards,
VictoriaMay 8, 2017 at 9:58 pm #789875I am using relevanssi plugin and the Enfold Search Dropdown doesn’t include the included search parameters set in Relevanssi and produces separate results. For the sake of consistency, it is in my clients best interest to disable the AJAX dropdown. How can I disable the AJAX search dropdown but keep the search magnify glass in the menu?
May 9, 2017 at 1:08 pm #790229Hi blafoley,
You can make a custom form and code that would handle that form submit. You might want to hire a freelancer to that for you.
Here are some threads to consider
https://kriesi.at/support/topic/enfold-removing-the-search-magnifying-glass-and-adding-in-the-search-field/
https://kriesi.at/support/topic/searchbox-in-header-menu/#post-267356Best regards,
VictoriaMay 9, 2017 at 5:51 pm #790482Hi Victoria,
I don’t think you’re understanding my question. I don’t want to remove the Enfold search magnify glass, nor do I wish to replace it with anything else.
I want to remove the Ajax dropdown of search results once you start typing. I will find a work around it.
May 9, 2017 at 7:41 pm #790532add_filter('avf_frontend_search_form_param', 'avia_deactivate_ajax_search',10,1); function avia_deactivate_ajax_search($params) { $params['ajax_disable'] = true; return $params; }
This solved my problem to just remove the AJAX dropdown but keep the Magnify Glass in the main menu.
May 10, 2017 at 5:17 am #790821Hi,
Great, glad you found a solution and thanks for sharing, much appreciated :-)
Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJuly 20, 2018 at 4:08 pm #987889Hi Guys, it is really necessary to include some custom fields in the search. Maybe someone can help?
With this i already extended the standard search to find the Woocommerce SKU´s :
http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_joinMAybe with this we can combine my needs
July 21, 2018 at 9:25 pm #988225Hi hunter74,
Can you please explain a bit more what you’re trying to achieve?
Best regards,
VictoriaJuly 23, 2018 at 10:17 am #988630Hi Victoria,
with my explanation above I could expand the standard WordPress Search. The Searchmodul now also including the SKU of my Product.
But When I make a search in the Ajax Searchfield with typing the SKU of my product, the product can not be found.
I hope it is not so difficult to add this to the Ajax Search.
July 24, 2018 at 6:18 pm #989284Hi,
I can only point you to the right direction because this topic is beyond the scope of our support forum. You an use this code to modify the ajax search query:
add_filter('avf_ajax_search_function', 'avia_init_custom_ajax_search', 10, 4); function avia_init_custom_ajax_search($function_name, $search_query, $search_parameters, $defaults) { $function_name = 'avia_custom_ajax_search'; return $function_name; } function avia_custom_ajax_search($search_query, $search_parameters, $defaults) { global $query; $tempquery = $query; if(empty($tempquery)) $tempquery = new WP_Query(); $tempquery->query_vars = $search_parameters; new WP_Query($tempquery); $posts = $tempquery->posts; return $posts; }
Basically you need to replace
$tempquery->query_vars = $search_parameters; new WP_Query($tempquery);
with your custom query code – i.e. add additional query/search parameters or call a custom query function (like relevanssi_do_query() if you’re using Relevanssi ( https://www.relevanssi.com/knowledge-base/relevanssi_do_query/ ).
Best regards,
Dude -
AuthorPosts
- You must be logged in to reply to this topic.