导航下拉菜单问题没有出现在带有移动设备的网站上。使用王国主题
网站:www.fleeknsleek.com
`CSS片段:
.navigationbar {
border: none;
border-left: none;
border-right: none;
width: 100%;
position: relative;
}
.kd-menu-effect {
width:100%;
height: 100%;
background-color: rgba(0,0,0,.5);
position: relative;
z-index: 99;
display: none;
}
#alternate_menu {
z-index: 999;
}
html body .kd_alternate_menu .kd_alternate_menu-submenu-items a {
color:#333;
}
.navigationbar .container {
position: relative;
}
.navigationbar ul.kd_main_menu {
display: table;
margin: 0;
padding: 0;
width: 100%;
position: relative;
}
.navigationbar .kd_main_menu li {
color: #2f2f2f;
display: inline-block;
font-family: "Open Sans";
font-size: 18px;
font-weight: 700;
letter-spacing: 0.06em;
list-style: none;
padding: 7px 0 7px;
position: relative;
text-transform: uppercase;
}
.navigationbar .kd_main_menu li:hover {
background: rgba(255,255,255,0.08);
}
.navigationbar .kd_main_menu > li a {
display: block;
padding: 0px 20px 20px 20px;
}
.navigationbar .kd_main_menu > li.homeicon a {
font-size: 15px !important;
padding-left: 18px;
padding-right: 25px;
}
.navigationbar .kd_main_menu > li.homeicon a i {
vertical-align: middle;
}
.navigationbar .kd_main_menu li a {
color: #2c3e50;
font-weight: 700;
letter-spacing: 0.06em;
}
.navigationbar .kd_main_menu li a i.fa {
display: inline-block;
margin-right: 5px;
margin-left: 5px;
}
.navigationbar .kd_main_menu .kd_active,
.navigationbar .kd_main_menu li a:hover {
color: #781b80;
}
.navigationbar .kd_main_menu > li.current-menu-item a {
color: #781b80;
}
.navigationbar .kd_main_menu .tree-col {
width: 540px !important;
}
.navigationbar .kd_main_menu .two-col {
width: 320px !important;
}
.navigationbar .kd_main_menu .one-col {
width: 180px !important;
}
.navigationbar .kd_main_menu .sub-menu {
background-color: #ffffff !important;
box-shadow: 0px 1px 4px 0px rgba(0,0,0,0.3) !important;
display: none;
left: 0;
min-width: 250px;
overflow: visible !important;
padding: 15px 25px;
position: absolute;
top: 60px;
width: 100%;
z-index: 500;
}
.navigationbar .kd_main_menu .sub-menu li {
background-image: none;
color: #6e6e6e;
display: block;
font-size: 18px;
padding: 0;
}
.navigationbar .kd_main_menu .sub-menu li a {
color: #262626;
font-size: 18px;
font-weight: 700;
margin: 0px 0px 0px 0px;
padding: 6px 0;
text-transform: none;
}
.navigationbar .kd_main_menu .sub-menu li:first-child a {
font-weight: 700;
}
.navigationbar .kd_main_menu .sub-menu li a:hover {
color: #c73030;
}
.navigationbar .kd_main_menu > li:hover .sub-menu {
display: block;
}
.navigationbar .kd_main_menu > li:hover i.icon_arrow-menu {
display: block;
}
.navigationbar i.icon_arrow-menu {
left: 10px;
position: absolute;
top: 22px;
display: none;
}
.menu-headline {
display: none;
text-align: left;
font-size: 16px;
position: relative;
z-index: 99;
color: #fff;
margin-top: 20px;
font-weight: bold;
text-transform: uppercase;
}
.menu-headline i {
position: absolute;
top: 4px;
right: 10px;
font-size: 20px;
}

Php片段:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div class="kd-menu-effect"></div>
<?php if( get_theme_mod('enable_top_bar') == 'YES' ) { ?>
<div class="kd_header_top">
<div class="container ">
<div class="row">
<div class="col-lg-6 col-md-5 col-sm-4 col-xs-12">
<?php
if(has_nav_menu( 'top_nav' )){
?>
<!-- Main Menu -->
<nav class="kd_header_top_menu">
<?php
wp_nav_menu(array(
'theme_location' => 'top_nav',
'menu_id' => 'top_nav'
));
?>
</nav>
<?php
}
?>
</div>
<div class="col-lg-6 col-md-7 col-sm-8 col-xs-12">
<?php if( get_theme_mod( 'email' ) ){ ?>
<div class="kd_email_support">
<a href="mailto:<?php echo get_theme_mod( 'email' ); ?>"><?php echo get_theme_mod( 'email' ); ?></a>
</div>
<?php } ?>
<?php if( get_theme_mod( 'phone_no' ) ){ ?>
<div class="kd_phone_support">
<a href="tel:<?php echo get_theme_mod( 'phone_no' ); ?>"><?php echo get_theme_mod( 'phone_no' ); ?></a>
</div>
<?php } ?>
<ul class="kd_header_social_list">
<?php if( get_theme_mod('head_facebook_url_on') == 'YES' ) { ?>
<li>
<a href="<?php echo esc_url( get_theme_mod('head_facebook_url') ); ?>" target="_blank">
<i class="fa fa-facebook" aria-hidden="true"></i>
</a>
</li>
<?php } ?>
<?php if( get_theme_mod('head_twitter_url_on') == 'YES' ) { ?>
<li>
<a href="<?php echo esc_url( get_theme_mod('head_twitter_url') ); ?>" target="_blank">
<i class="fa fa-twitter" aria-hidden="true"></i>
</a>
</li>
<?php } ?>
<?php if( get_theme_mod('head_youtube_url_on') == 'YES' ) { ?>
<li>
<a href="<?php echo esc_url( get_theme_mod('head_youtube_url') ); ?>" target="_blank">
<i class="fa fa-youtube-play" aria-hidden="true"></i>
</a>
</li>
<?php } ?>
<?php if( get_theme_mod('head_gplus_url_on') == 'YES' ) { ?>
<li>
<a href="<?php echo esc_url( get_theme_mod('head_gplus_url') ); ?>" target="_blank">
<i class="fa fa-google-plus" aria-hidden="true"></i>
</a>
</li>
<?php } ?>
<?php if( get_theme_mod('head_instagram_url_on') == 'YES' ) { ?>
<li>
<a href="<?php echo esc_url( get_theme_mod('head_instagram_url') ); ?>" target="_blank">
<i class="fa fa-instagram" aria-hidden="true"></i>
</a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
<?php if( has_nav_menu( 'main_nav' ) || has_nav_menu('alternate_nav') ) { ?>
<!-- Main Menu -->
<nav class="navigationbar <?php echo has_nav_menu( 'alternate_nav' ) ? 'kd_has_alternate_nav' : ''; ?>">
<div class="container">
<?php
if( has_nav_menu('alternate_nav') ) {
$menu_name = 'alternate_nav';
$locations = get_nav_menu_locations();
$menu_id = $locations[ $menu_name ] ;
$menu = wp_get_nav_menu_object($menu_id);
echo '<div id="alternate_menu"><span>' . ( $menu->name ) . '</span>';
wp_nav_menu(array(
'theme_location' => 'alternate_nav',
'menu_class' => 'kd_alternate_menu ' . ( get_theme_mod('enable_display') == 'YES' ? "kd_default_open_hp" : '') . '',
'walker' => new kingdom_themeWalkerMainNav()
));
echo '</div>';
}
if( has_nav_menu( 'main_nav' ) ) {
?>
<div class="menu-headline">
<span data-alttext="Close Shopping">Shopping</span>
<i class="micon icon-menu7"></i>
</div>
<?php
wp_nav_menu(array(
'theme_location' => 'main_nav',
'menu_class' => 'kd_main_menu',
'walker' => new kingdom_themeWalkerMainNav()
));
}
?>
</div>
</nav>
<?php } ?>
<!-- Header Elements -->
<div class="kd_header_bg_color">
<div class="container ">
<div class="kd_header_elements">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
<?php
$logo_width = ( get_theme_mod( 'logo_width' ) ) ? get_theme_mod( 'logo_width' ) : '100%';
$logo_height = ( get_theme_mod( 'logo_height' ) ) ? get_theme_mod( 'logo_height' ) : '100%';
?>
<div class="kd_logo" style="max-width: <?php echo $logo_width; ?>; max-height: <?php echo $logo_height; ?>;">
<a href="<?php echo esc_url( home_url('/') );?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
<?php if( get_theme_mod( 'logo' ) ){
echo '<img style="max-width: ' . $logo_width . '; max-height: ' . $logo_height . ';" src="' . get_theme_mod( 'logo' ) . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '">';
} else {
echo '<img style="max-width: ' . $logo_width . '; max-height: ' . $logo_height . ';" src="' . esc_url( (kingdom()->cfg['paths']['theme_dir_url']) . '/images/kd_logo.png' ) . '" alt="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '">';
}
?>
</a>
</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-6 col-xs-12">
<div class="kd_search">
<form role="search" action="<?php echo esc_url( home_url('/') ); ?>" method="get">
<input type="hidden" name="post_type" value="product" />
<button type="submit" class="kd_search_submit" value="<?php esc_html_e( 'Search', 'kingdom');?>" ><i class="fa fa-search" aria-hidden="true"></i></button>
<input type="text" id="search" name="s" placeholder="<?php esc_html_e( 'type to search', 'kingdom'); ?>" />
</form>
</div>
<?php
if( kingdom()->is_woo_activated() ) {
?>
<div id="kd_checkout_wrap">
<a href="<?php echo WC()->cart->get_checkout_url(); ?>" class="kd_checkout_button"><?php esc_html_e( 'Checkout', 'kingdom'); ?></a>
<div class="kd_small-cart">
<div class="kd_cart-title">
<i class="micon icon-cart5"></i>
<?php global $woocommerce; ?>
<a class="cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e('View your shopping cart', 'kingdom'); ?>"><?php esc_html_e( 'Cart', 'kingdom' ); ?>:
<span><?php echo $woocommerce->cart->get_cart_total(); ?></span></a> -
<span class="kd_cart-itemsnumber">(<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'kingdom'), $woocommerce->cart->cart_contents_count);?> )</span>
</div>
<div class="cart-details-wrapper">
<?php
//wc_get_template( 'cart/mini-cart.php' );
?>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div><!-- END HEADER ELEMENTS -->
</div>
<?php } ?>
<?php
if( is_search() == false ) {
if( isset(kingdom()->coreFunctions->data['layout']) && isset(kingdom()->coreFunctions->data['layout']['revolution_slider_select']) ) {
$revslider_select = kingdom()->coreFunctions->data['layout']['revolution_slider_select'];
//var_dump($revslider_select);
//die;
if( isset($revslider_select) && $revslider_select != '' && $revslider_select != 'no-slider' ) {
echo do_shortcode('[rev_slider alias="' . $revslider_select . '"]');
}
}
}
?>
<!-- Breadcrumbs -->
<?php
if( !is_front_page() ){
?>
<div class="kd_breadcrumbs_bk">
<div class="container">
<div class="row">
<?php echo kingdom()->coreFunctions->display_breadcrumbs();?>
</div>
</div>
</div>
<?php
}
?>
&#13;
我需要帮助解决此问题。 提前谢谢!