Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1073978

    Hallo
    there is a ajax-search-field in the header of your theme.
    How can i bring this searchbox into the sidebar (ajax!)?

    Danny

    #1074058

    Hey Flugtraeumer,
    To add the search bar to the sidebar please add the following code to functions.php file from Appearance > Editor

    add_shortcode('avia_search', 'get_search_form');

    Add the following shortcode in a HTML widget

    [avia_search]

    Best regards,
    Mike

    #1075060

    Does not work:

    there is a ajax-search-field in the header of your theme.
    How can i bring this searchbox into the sidebar (ajax!)?

    #1075074

    Hey,

    Please enable debugging mode – https://kriesi.at/documentation/enfold/intro-to-layout-builder/#debug-mode, add your search element to your page and then copy the shortcode from debugging field below Advanced Layout Builder and paste it into HTML widget in Appearance > Widgets

    Cheers!
    Yigit

    #1080755

    Its a royal pain that most of you mods think that your users are idiots and that many of you does not even read what a user is writing in his thread.
    You waste your users time and with this rude and respectless behaviour you produce costs for us since we have to wait and wait and wait until things get solved.
    Seems as if i should rate your item accordingly on themeforst.

    back to topic:
    Did i say somewhere that i did not already activated the debug mode???

    #1080891

    Hi,

    You also did not say that you have activated it. We cannot just assume that you did and skip that crucial step. Next time, please provide as much information as possible so we would not waste time :)

    We released Enfold 4.5.5 yesterday. Please update the theme to the latest version, then go to Enfold theme options > Performance and “Scan Widgets for Theme Shortcodes”.

    Best regards,
    Yigit

    #1330595

    Hi Yigit,

    And how do I add settings to this shortcode?
    When I use the shortcode [avia_search] I get all the results and i want only 8 to see.

    Greets Janine

    #1330681

    Hi,
    Sorry this shortcode doesn’t have options it only calls the WordPress search function get_search_form as seen in the shortcode function:
    add_shortcode('avia_search', 'get_search_form');
    You can try the many different plugins available or you can review this tutorial to Create a Custom WordPress Search Results Page.
    The only easy way I found to limit the search results to the first 8 is to use this function which only shows this first 8 and hides the search results title, pagination and heading.
    Try adding this code to the end of your functions.php file in Appearance ▸ Editor:

    function limit_search_results() { ?>
        <script>
    (function($){
      $('#top.search-results .template-search article').hide();
      $('#top.search-results .title_container').hide();
      $('#top.search-results .template-search .pagination').hide();
      $('#top.search-results .template-search .extra-mini-title').hide();
      $('#top.search-results .template-search article').slice(0, 8).show();
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'limit_search_results');

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to move the search box into the sidebar?’ is closed to new replies.