I am using free WordPress Theme called Modern-Buisness, but when viewing in mobile view, clicking the menu icon just does nothing. I will not display the mobile menu.
Here is the code I think directly involves this function. It is from the wp-content/themes/modern-business/functions.php file. Is there something wrong with this code?
<code>`
/*** This function outputs mobile a navigation HTML structure combining both the top and primary menu items. */
if ( ! function_exists( 'mb_mobile_menu' ) ) {
function mb_mobile_menu() {
global $post, $sds_theme_options;
$nav_menu_locations = get_nav_menu_locations();
?>
<ul id="mobile-menu" class="menu mobile-menu mobile-nav">
<?php
// Make sure we have nav menus and they aren't empty
if ( $nav_menu_locations = array_filter( $nav_menu_locations ) ) :
// Make sure the top menu is always above the primary menu
array_multisort( $nav_menu_locations, SORT_DESC );
foreach( $nav_menu_locations as $menu_location_key => $menu_location ) :
$nav_menu_object = wp_get_nav_menu_object( $menu_location ); // Get current nav menu object
?>
<li class="menu-item menu-label <?php echo $menu_location_key . '_label'; ?>"><?php echo $nav_menu_object->name; ?></li>
<?php
$nav_menu_items = wp_get_nav_menu_items( $menu_location );
// Loop through nav items
if ( ! empty( $nav_menu_items ) ) :
foreach( $nav_menu_items as $menu_item ) :
if ( ! $menu_item->menu_item_parent ) : // Only parent elements
?>
<li class="menu-item <?php echo ( $menu_item->object_id == $post->ID ) ? 'current-menu-item current-nav-item current_page_item' : false; ?>"><a href="<?php echo $menu_item->url; ?>"><?php echo $menu_item->title; ?></a></li>
<?php
endif;
endforeach;
endif;
endforeach;
// Output primary nav "default/fallback" menu items if primary nav is not set
else:
?>
<li class="menu-item menu-label primary_nav_label"><?php printf( __( '%1$s', 'modern-business' ), apply_filters( 'modern_business_primary_nav_fallback_label', 'Primary Menu:' ) ); ?></li>
<?php
wp_list_pages( array(
'depth' => 1,
'title_li' => false
) );
endif;
?>
</ul>
<?php
}
}`
Thank you very much for any support you can offer, I greatly appreciate it.
Aucun commentaire:
Enregistrer un commentaire