-
AuthorPosts
-
October 4, 2016 at 4:39 pm #695136
Hello,
I have successfully moved the Search to the Top Bar of my site, and it works correctly. We did this by using your suggestion to do the following:
In “functions-enfold”, I have replaced
if ((is_object($args) && $args->theme_location == ‘avia’) || (is_string($args) && $args = “fallback_menu”))
with
if ((is_object($args) && $args->theme_location == ‘avia2’) || (is_string($args) && $args = “fallback_menu”))
However, I am wanting to have the search be a text box that is NOT in a modal popup. How can I eliminate the “click to popup” search field, and simply embed the field instead? Also, need to make sure that the ajax results aren’t on a transparent background, and are in front of the navigation menu?
Here is an image of what we have achieved on our development server so far:
https://snag.gy/ar8fUI.jpgOctober 5, 2016 at 7:14 am #695318Hi nickydef,
Could you post a link to the site in question so that we can take a closer look please?
Regards,
RikardOctober 5, 2016 at 12:13 pm #695424It’s on our local machine, under development, and is not publicly accessible! However, it is a standard installation of version 3.8, and is using “Logo left, Menu right” with “Header Phone Number/Extra Info” and “Header Secondary Menu” displayed in the top bar at the right. Used the code above to display the search in the top bar instead of next to the navigation menu.
October 6, 2016 at 4:26 pm #696103Hi,
Please add following code to Functions.php file in Appearance > Editor
add_shortcode('avia_search', 'get_search_form');
then add following shortcode into your secondary menu as a new custom link
[avia_search]
Best regards,
YigitOctober 6, 2016 at 4:44 pm #696108What other steps? All that does is add a link that goes nowhere when clicked? That doesn’t add a form…
Do I need to remove the changes I have made to the “functions-enfold” file shown above?Here’s what I got by adding the code you’ve provided, and adding a Custom Link to the menu – had to give it a Navigation Label of “Search”, or it wouldn’t save it.
https://snag.gy/kZqh0s.jpgOctober 6, 2016 at 5:05 pm #696113**UPDATE** – Added the shortcode to the “Phone Number or small info text” area, and this does work – kind of…
It adds the search form (I’ll need to style it with quick css), but uses ajax to show search results, and makes the top bar push all other content down, and has a transparent background? How do I disable the ajax results, and just have the results come up in a separate page?
See image: https://snag.gy/HO57zo.jpgOctober 8, 2016 at 6:01 am #696804Hey!
Please add this code in the functions.php file to disable the ajax search functionality.
add_action('after_setup_theme', 'ava_disabled_ajax_search'); function ava_disabled_ajax_search() { //now hook into wordpress ajax function to catch any ajax requests remove_action( 'wp_ajax_avia_ajax_search', 'avia_ajax_search' ); remove_action( 'wp_ajax_nopriv_avia_ajax_search', 'avia_ajax_search' ); }
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.