Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 page

    I want to only display post on ajax search, is it possible?

    Thanks!

    José

    #248578

    Hi 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!
    David

    #248790

    Thanks 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é

    #249014

    Hey!

    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,
    David

    #1247298

    I want to display more items in the ajax search? This should be an easy thing?

    #1247381

    Hi,


    @hunter74
    Please add following code to bottom of Functions.php file of your child theme and adjust the value as needed

    add_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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.