-
AuthorPosts
-
March 3, 2019 at 5:16 pm #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
March 3, 2019 at 10:28 pm #1074058Hey Flugtraeumer,
To add the search bar to the sidebar please add the following code to functions.php file from Appearance > Editoradd_shortcode('avia_search', 'get_search_form');
Add the following shortcode in a HTML widget
[avia_search]
Best regards,
MikeMarch 5, 2019 at 8:36 pm #1075060Does not work:
there is a ajax-search-field in the header of your theme.
How can i bring this searchbox into the sidebar (ajax!)?March 5, 2019 at 9:06 pm #1075074Hey,
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!
YigitMarch 20, 2019 at 11:01 am #1080755Its 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???March 20, 2019 at 4:17 pm #1080891Hi,
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,
YigitNovember 26, 2021 at 1:08 pm #1330595Hi 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
November 27, 2021 at 5:00 pm #1330681Hi,
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 -
AuthorPosts
- The topic ‘How to move the search box into the sidebar?’ is closed to new replies.