Mobile dropdown menu starts open after update

Hello,

After an Wordpress update, the dropdown menu is already open when you visit the website. I have to push the menu button twice to close it.

Does someone know how to fix this?

Jan

Hi Jan,

Please double check the version of X and Cornerstone are both updated to the latest version. Here is a link for a details information on how to do an update:

Please remember to clear all caches when updating so that the code from the latest release is always in use. This will help you to avoid any potential errors or any unexpected display issue on the site.

If the issue persists, try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes!

I tried everything you said, but the dropdown still doesn’t work. Is it the script?

Hi Jan,

Could you try switching to the main theme instead of child theme? I checked and your menu structure is still old, perhaps you have existing customization in your child theme which only applicable to the version when it’s added.

Thanks!

This is the customized code in nav-primary.php inside the child-theme, I can’t see the problem…

<?php // ============================================================================= // VIEWS/GLOBAL/_NAV-PRIMARY.PHP // ----------------------------------------------------------------------------- // Outputs the primary nav. // ============================================================================= if( function_exists( 'ubermenu' ) && $config_id = ubermenu_get_menu_instance_by_theme_location( 'primary' ) ): ubermenu( $config_id, array( 'theme_location' => 'primary') ); else: ?> <?php _e( 'Navigation', '__x__' ); ?> Reserveren <?php x_output_primary_navigation(); ?>
<?php x_output_primary_navigation(); ?>
<?php endif; ?>

a href="#" class=“x-btn-navbar collapsed” data-toggle=“collapse” data-target=".x-nav-wrap.mobile">
i class=“x-icon-bars” data-x-icon=“”>
span class=“visually-hidden”><?php _e( 'Navigation', '__x__' ); ?>

I removed a few < otherwise the code wasn’t showing in this post

Hi,

Please replace your code with this

<?php

// =============================================================================
// VIEWS/GLOBAL/_NAV-PRIMARY.PHP
// -----------------------------------------------------------------------------
// Outputs the primary nav.
// =============================================================================

if( function_exists( 'ubermenu' ) && $config_id = ubermenu_get_menu_instance_by_theme_location( 'primary' ) ):
	ubermenu( $config_id, array( 'theme_location' => 'primary') );
 else: ?>

<a href="#" id="x-btn-navbar" class="x-btn-navbar collapsed" data-x-toggle="collapse-b" data-x-toggleable="x-nav-wrap-mobile" aria-expanded="false" aria-controls="x-nav-wrap-mobile" role="button">
  <i class="x-icon-bars" data-x-icon-s="&#xf0c9;"></i>
  <span class="visually-hidden"><?php _e( 'Navigation', '__x__' ); ?></span>
</a>
<a class="res-button" href="http://cleynalserd.nl/reserveren">Reserveren</a>
<nav class="x-nav-wrap desktop" role="navigation">
  <?php x_output_primary_navigation(); ?>
</nav>

<div id="x-nav-wrap-mobile" class="x-nav-wrap mobile x-collapsed" data-x-toggleable="x-nav-wrap-mobile" data-x-toggle-collapse="1" aria-hidden="true" aria-labelledby="x-btn-navbar">
  <?php x_output_primary_navigation(); ?>
</div>

<?php endif; ?>

Hope this helps

That did the job, thank you very much! Also for the great quick responses from all staff members.

Jan

You’re welcome!
We’re glad @Paul.r were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.