-
AuthorPosts
-
May 20, 2020 at 2:17 am #1214475
Hi there, I’m trying to make some tweaks to the main menu and the search bar location but I’m running up against some issues. To add a search bar I followed the directions here -> https://kriesi.at/support/topic/adding-search-bar-to-header-cant-find-enfoldincludes-folder/#post-476685
It worked, but the position isn’t where I’d like it. Ideally It would be above the menu – roughly inline with the bottom of the logo but on the right side (above News & Events.) I’ve added a ‘top: -100px;’ rule (which I’ve since removed) for #top #menu-item-search #searchform div and that gets the position where I’d like it, but I can’t style it properly – and it doesn’t seem the right way to do it. Also, I’d like to style the search bar so that it has a blue border, with a white background and with the ‘Search’ text in blue.
Another issue I’m having is that the menu for Programs & Services opens to right of where it should open. All the other menus open directly below the text but Programs & Services opens to the right – I’m guessing this may be related to the fact that it’s a mega menu and the other menus are normal – but that’s just a guess.
The final issue is that when you hover over the entries in the menus you can’t read the text as the blue highlight is the same color as the text. How could I set it up so that the text turns white when a person hovers over the menu entries?
I’ve tried figuring these issues out myself, but I’m not making any progress. Any help you could offer would be greatly appreciated!
Thanks in advance!
Brendan
- This topic was modified 4 years, 6 months ago by BrendanG.
May 25, 2020 at 5:41 pm #1216199Hi guys, I’d really like to start making progress on this. Do you need more information or is there anything else I can provide that will help move this towards completion?
Thanks,
Brendan
May 26, 2020 at 10:37 am #1216435Hi,
Sorry for the delay. The snippet in the previous thread should render the search bar inside the header beside the logo, but in your installation the search bar is inside the menu container. Did you adjust the snippet?
You can use this css to adjust the style of the search field.
#header .custom-form #s { /* style here */ }
Best regards,
IsmaelMay 26, 2020 at 7:48 pm #1216630Hi Ismael, thanks for your response. I accidentally linked to a different post from the one I borrowed the PHP code from. This was the code I previously inserted into Functions.PHP:
add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 ); function avia_append_search_nav ( $items, $args ) { if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items; if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu")) { global $avia_config; ob_start(); $getform = get_search_form(false); $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown">'.$getform.'</li>'; } return $items; } ?>
With this CSS:
#top #menu-item-search #searchform div { opacity: 1 !important; display: block !important; margin-left: 20px; }
I’ve since changed the code to the post I linked to in my first post – while it fixes some problems, it also creates new ones. The first code I used removed the search icon from the menu – which I wanted. The new version still has it.
I’m also having difficulty positioning the search bar where I want it. I’d like it to be directly above the ‘News & Events’ menu item and to stay there with different sized windows. Because of the way it’s styled now, when the user scrolls down and the logo shrinks the search bar goes on top of the menu items which doesn’t look great.
Also there were two other issues mentioned in my first post that didn’t get addressed:
In summary here are the three things I would like help with:
- 1. Positioning the search bar above News & Events / remove the search icon.
- 2. The Programs & Services menu opens up to the right of where it should – this doesn’t look correct.
- 3. How to style the hover color of the menu items – right now the hover is blue and the text is blue making the text invisible.
Getting your help with these three items would be greatly appreciated,
Brendan
- This reply was modified 4 years, 6 months ago by BrendanG.
June 1, 2020 at 7:53 am #1218345Hi,
Sorry for the delay. Looks like you’ve already managed to move the search bar above the menu. If you want to disable the default search icon, go to the Enfold > Main Menu > General tab and tick the Append search icon to main menu option off. And to change the hover color of the sub menu items, please add this code in the Quick CSS field.
#top #wrap_all .header_color .main_menu .menu ul li > a:hover { color: #ffffff; }
Best regards,
IsmaelJune 1, 2020 at 7:02 pm #1218496Hi Ismael, as much as I appreciate your help I feel that you’re only partially answering my questions and not fully reading what I’m posting.
The positioning of the search bar is not resolved – I still need help with this. I’d like it to be directly above the ‘News & Events’ menu item and to stay there with different sized windows.
There are two problems I’m having with the way it’s being positioned now:
1. It doesn’t look good at different window widths (please go to the website and change the width to see what I mean.)
2. When the user scrolls down and the logo area shrinks, the search bar gets pushed into the layer slider area – this doesn’t look good. (please go to the website and scroll down to see what I mean.)The other issue that is still unresolved (and seems like an Enfold theme bug to me) is that the sub-menu for Programs & Services is not properly aligned. It is the only sub-menu with this issue – it’s also the only sub-menu that is a mega menu. Please go to the website and hover over Programs & Services to see what I mean.
In summary:
1. I still need help with positioning the search bar
2. The sub-menu for Programs & Services still needs to be fixed.I appreciate you guys are busy, but this has been going on for nearly two weeks. I *really* want to start making faster progress on this. Please look at this as soon as possible and respond to all the points I’ve laid out above.
Thanks in advance,
Brendan
- This reply was modified 4 years, 5 months ago by BrendanG.
June 2, 2020 at 10:08 pm #1218861Update: I’ve managed to improve the positioning of the Programs & Services sub-menu – but I still need help positioning the search bar.
June 8, 2020 at 8:32 am #1220379Hi,
Can you replace the action hook with ava_inside_main_menu so that the search field is rendered inside the menu container instead of the main header. We can then add css to adjust the position so that it’s above the News & Events menu item.
After changing the hook name, add this css code to move the search bar.
.custom-form { position: absolute; right: 100px; top: -60px; }
You should also adjust the color of the text inside the search field.
#header .custom-form #s { background-color: #0086ce; color: #ffffff; }
Best regards,
IsmaelJune 12, 2020 at 11:31 pm #1222220Thank you, it’s working.
June 13, 2020 at 1:04 am #1222242Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Search bar location, and main menu tweaks’ is closed to new replies.