Show results onload homepage

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Show results onload homepage

This topic contains 8 replies, has 2 voices, and was last updated by gutiseo gutiseo 7 years ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #5075
    gutiseo
    gutiseo
    Participant

    Hi,
    I would like to know if it’s possible to show results custom search onload homepage. I would like to show search results in advance before user ask in search box.
    And where could I change istopic results css?
    Thnaks in advance.
    Regards!

    #5078
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    The only way is using a custom script code in your website footer. First you will need to change one setting though, in order to make the search work with 0 input characters.

    1. Go to the General Options -> Behavior panel and change the “Minimal character count to trigger search” option to 0

    2. Add this script to your theme footer before the closing body tag: http://pastebin.com/raw.php?i=6hymZi4h

    You can change the searchPhrase variable in that code if you want to use a default search phrase.

    I do not recommend changing the CSS files directly as most of them are generated dynamically based on back-end values. Moreover updating the plugin will override all of your changes.
    Most of the settings you can change on the Theme Options -> Isotopic results panel.
    Rather changing the CSS I recommend adding your custom CSS code to the Theme Options -> Custom CSS panel. It’s safe and does not get overridden by updates.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #5080
    gutiseo
    gutiseo
    Participant

    Hi Ernest,
    unfortunately your solution is not working, or I’m coding wrong your code.
    I have edited footer with:

    <script type="text/javascript">
    jQuery(function($) { 
      
      // Change this variable to any search prhase if you want to
      var searchPhrase = "Playa";
    
      var $input = $($("input.orig").get(0)); 
      $input.val(searchPhrase);
      $input.keyup(); 
    });
    </script>

    I setted up behavour to “Minimal character count to trigger search” option to 0

    It only shows search box with keyword “Playa” inside, but doesn’t show any results where I placed results shortcode. Only when I begin to type again it shows results.

    Thanks for your quick answer. Awesome support.

    Regards!

    #5082
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Okays, I think I might know why.

    I’ve made a modification to the code, please try again: http://pastebin.com/raw.php?i=6hymZi4h

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #5083
    gutiseo
    gutiseo
    Participant

    Hi Ernest,
    I have published new code inside footer.php and still not working.
    Maybe I have to set triggers in behaviour different?
    My configuration in General Options -> Behavior is:
    trigger when click on icon, on return and when filters changes.
    and in Layout options – > Results behaviour
    scroll the window to result list

    Thank you!

    #5084
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh then, definitely that’s the problem. The script is trying to trigger a key-up event, which is not working of course.

    So all you need to do is change line 16 of the code I’ve given you from:

    $input.keyup();

    to:

    $($(“.promagnifier”).get(0)).click();

    And that will trigger the icon click instead, which hopefully works 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #5085
    gutiseo
    gutiseo
    Participant

    Not working yet. Search phase has dissapear from search box and results don´t appear bellow yet.
    You can take a look to my wordpress archives inside admin in Appareance -> Theme editor because footer.php is writable from there.
    And trigger search when typing doesn’t work with this code.
    Thanks in advance and I’m sorry to disturb you.
    Regards!

    #5086
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    No problem at all, happy to help you 🙂

    I’ve found the problem. I suppose when copy-pasting from my previous post the double quotes (“) were glitched and displayed incorrectly.

    I’ve changed them to single quotes in your theme footer.php, it seems to be working now.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #5087
    gutiseo
    gutiseo
    Participant

    Thank you so much! Now it works perfect!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.