-
AuthorPosts
-
April 6, 2014 at 3:38 pm #247914
Hi!
When I write, for example, the word “Whisky” on the ajax search in a page, for example http://www.adw.cl/, the results returned are:
– 3 posts
– 1 object (a Hotspot object that has a link but no content)
– 1 pageI want to only display post on ajax search, is it possible?
Thanks!
José
April 8, 2014 at 2:46 am #248578Hi jmaguirrei!
If you need to modify the search implementations you can find the files here : /functions-enfold.php
If you change numberpost => 5 to 1 ( see below ) this will show 1, BUT you need to customize further to have more accuracy when you search, otherwise it will show you irrelevant information / not so accurate, or it will show you what you need, depends on the case scenario.
$defaults = array('numberposts' => 1, 'post_type' => 'any', 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => false);
P.S Create 1 post and ask your questions there, as opposed to open more than 1 thanks :)
Cheers!
DavidApril 8, 2014 at 3:15 pm #248790Thanks David, I replaced ‘post_type’ => ‘any’ for ‘post_type’ => ‘post’ and it works fine!
The only issue is that in the search page after click on ‘View all results’, for example: http://www.adw.cl/?s=whisky the lists displayed has all types of posts, not only real post.
Where can I modify this?
Thanks!!
Regards
JoséApril 9, 2014 at 2:32 am #249014Hey!
While we would like to offer custom mods, to all of the entries we can just limit that to the complexity of the problem, i will like to suggest you this reliable/cost effective solution http://studio.envato.com/
Best regards,
DavidSeptember 21, 2020 at 10:29 am #1247298I want to display more items in the ajax search? This should be an easy thing?
September 21, 2020 at 3:16 pm #1247381Hi,
@hunter74 Please add following code to bottom of Functions.php file of your child theme and adjust the value as neededadd_filter('avf_ajax_search_query', 'avf_modify_ajax_search_query', 10, 1); function avf_modify_ajax_search_query($search_parameters){ parse_str($search_parameters, $params); $params['numberposts'] = 10; $search_parameters = http_build_query($params); return $search_parameters; }
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.