Tagged: enfold, header, search box
-
AuthorPosts
-
April 22, 2016 at 4:39 am #619475
I upgraded our Enfold installation today to the latest version.
When my page loads, the search box is showing up on the navigation bar and then after a few seconds it disappears.
It should be showing at all until the user clicks on the Magnifying Glass.
It’s happening in Edge & Chrome. It is not happening in FireFox.
how can I fix this?
Thanks.
Micah
April 22, 2016 at 12:10 pm #619815Hi tileproducts!
I believe it is due to custom styles added in the child theme. Please remove the custom styles and check again. if you still have issue we might need temporary access to the backend. Please share admin user and password details in private content with permission to deactivate all plugins and add custom code if necessary to help you resolve this issue.
Best regards,
VinayApril 27, 2016 at 12:49 am #622594I emptied out the styles.css in the child theme and the issue still remains.
Our child theme styles.css contained the following during my testing./* Theme Name: Enfold Child Description: A <a href='http://codex.wordpress.org/Child_Themes'>Child Theme</a> for the Enfold WordPress Theme. If you plan to do a lot of file modifications we recommend to use this Theme instead of the original Theme. Updating wil be much easier then. Version: 1.0 Author: Kriesi Author URI: http://kriesi.at Template: enfold */ /* General Custom CSS */
I have added back our custom css in our child theme. I have them backed up offline, if you need to edit or remove them for testing purposes, go ahead. If it is a CSS issue, please let me know what changed so that I don’t undo the fix.
I provided login credentials.
Thanks,
MicahApril 29, 2016 at 2:11 pm #624451Hi,
please deactivate all plugins to check which one is causing this issue and let us know if things get better for you.
If you have done this then let us know if we are allowed to deactivate one ore more of your plugins as well for testing purposes?Please update the theme to the latest version. That should fix any issues you are currently experiencing :)
To update to the latest version follow the instructions here.
Best regards,
AndyApril 29, 2016 at 8:27 pm #624755I have disabled all plugins and then deleted our custom CSS.
The issue still happens.
When I change to the Enfold Theme from the Child Theme, the problem goes away. I go back to the Child Theme and the problem returns.
Our theme is on Version 3.5.4 and states that it’s the current version.
What now?
Micah
April 29, 2016 at 8:53 pm #624765I found the source of the problem, it has to do with the PHP code that adds the search bar to the mobile menu.
https://kriesi.at/support/topic/search-widget-only-in-mobile-view/#post-517247
When I remove the PHP code, the problem goes away.
Now that I have tracked the problem down to your coding issues, please provide a resolution to this problem.
Thanks,
Micah
April 29, 2016 at 11:16 pm #624821Per the instructions in the other thread, I added this CSS.
@media only screen and (max-width: 767px) { #top #searchform>div { display: block !important; opacity: 1 !important; } }
I went ahead and added:
#top #searchform>div { display: none !important; }
This seems to have fixed my issue.
Please look over this fix and let me know if this is an appropriate fix.
Thanks,
Micah
April 30, 2016 at 1:53 am #624838Although my CSS did fix the problem, it caused the search to not show all. I removed the code.
Please let us know how to fix this issue.
Here is the code that’s causing this from our Child Theme’s functions.php.
add_filter( 'wp_nav_menu_items', 'avf_add_search', 3, 2 ); function avf_add_search( $items, $args ) { if ($args->theme_location == 'avia') { $search = '<li id="menu-item-search-mobile" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-18 current_page_item menu-item-top-level menu-item-top-level-5">'.get_search_form(false).'</li>'; $items = $search . $items; } return $items; }
Micah
May 2, 2016 at 11:12 pm #626083Any word on fixing this.
It’s our last issue holding us back from launching.
Thanks,
Micah
May 3, 2016 at 4:07 am #626137Hi,
Sorry for the delay. Please refrain from bumping the thread because it will be pushed back to the end of the queue. The code in the previous thread will add the search box in the mobile menu. It’s not going to work in the desktop view. https://kriesi.at/support/topic/search-widget-only-in-mobile-view/#post-517247
I checked the site but I don’t see the issue. Is this fixed?
Best regards,
Ismael`May 3, 2016 at 11:00 pm #626793Thanks for getting back to us. The issue is not resolved.
I understand that the code is for adding search on the mobile menu however it’s also showing the search briefly on the standard menu.
I disable all plugins, removed all custom CSS and the problem remains. When I remove your mobile menu search code from the funcitons.php the problem goes away.
I am 100% certain that it’s the offending code.
I am able to replicate this in Edge, Chrome, FireFox, IE, Safari PC. I attached a screenshot. I did notice that on initial page load it doesn’t always happen however it does show up 100% of the time when reload the page.
In case you don’t see it, try and refresh the page.
As for resolution, I have granted you admin access. Please login to our site and get this resolved or send me fixed code or a new way to add the search to the mobile menu.
Thanks,
Micah
May 5, 2016 at 6:36 pm #627945I know you don’t want topics bumped… However…Were now going on 2 weeks without a solution.
So… I am willing to bump this post even though I risk delaying support.
Waiting 3-4 days for answers that don’t provide resolution is delaying our launch.
Micah
May 6, 2016 at 6:30 am #628111Hi,
So… I am willing to bump this post even though I risk delaying support.
By doing this, you are only delaying our response more because the thread is pushed back 200 or 300 threads back. Please be patient while we go through the queue. Replace the code with the following:
add_filter( 'wp_nav_menu_items', 'avf_add_search', 3, 2 ); function avf_add_search( $items, $args ) { if ($args->theme_location == 'avia') { $search = '<li id="menu-item-search-mobile" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-18 current_page_item menu-item-top-level menu-item-top-level-5" style="display: none;">'.get_search_form(false).'</li>'; $items = $search . $items; } return $items; }
And make sure to add the css code:
@media only screen and (max-width: 767px) { #top #searchform>div { display: block !important; opacity: 1 !important; } }
Best regards,
IsmaelMay 6, 2016 at 8:14 pm #628457Awesome!! That updated functions.php code fixed the problem.
This item is now complete.
Thanks!!
Micah
- This reply was modified 8 years, 7 months ago by tileproducts.
May 8, 2016 at 5:39 am #628789 -
AuthorPosts
- The topic ‘Search box showing on navigation bar upon page load’ is closed to new replies.