我有静态网站,2年后我决定将其转换为WordPress。我制作了这个过程所需的所有PHP代码,网站在WordPress上工作正常但菜单汉堡按钮不再工作我不知道为什么?
http://floranow.ejad.solutions/
我将把旧的静态html头代码和新的php代码。
旧的静态html标题:
<header id="header">
<nav id="main-menu" class="navbar navbar-default navbar-fixed-top" role="banner">
<div class="container">
<a class="navbar-brand" href="index.html"><img src="images/logo.png" alt="logo"></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div id="desktpMenu" class="collapse navbar-collapse navbar-left " >
<ul class="nav navbar-nav" >
<li id="home1" class="scroll "><a href="#home">Home</a></li>
<li id="section21" class="scroll"><a href="#section2">about us</a></li>
<li id="Process1" class="scroll"><a href="#Process">Process</a></li>
<li id="ourStories1" class="scroll"><a href="#ourStories">Our stories</a></li>
<li class="scroll "><a href="#">NEWS</a></li>
<li class="scroll "><a href="#">FAQS</a></li>
<li class="scroll "><a href="#thfrm">Contact us</a></li>
</ul>
</div>
</div><!--/.container-->
<div id="mbmenu" class="collapse navbar-collapse navbar-left " >
<ul class="nav navbar-nav" >
<li class="scroll"><a href="#layerslider">Home</a></li>
<li class="scroll"><a href="#section2">about us</a></li>
<li class="scroll"><a href="#Process">Process</a></li>
<li class="scroll"><a href="#ourStories">Our stories</a></li>
<li class="scroll "><a href="#thfrm">Contact us</a></li>
</ul>
</div>
</nav><!--/nav-->
</header><!--/header-->
新的php:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php bloginfo('name')?><?php wp_title(); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
<link rel="shortcut icon" href="<?php echo esc_url( get_template_directory_uri() ) ;?>/favicon.ico"/>
<!-- core CSS -->
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/font-awesome.min.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/animate.min.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/owl.carousel.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/owl.transitions.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/prettyPhoto.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/main.css" rel="stylesheet">
<link href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/responsive.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/style_common.css" />
<link rel="stylesheet" type="text/css" href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/style2.css" />
<link rel="stylesheet" type="text/css" href="<?php echo esc_url( get_template_directory_uri() ) ?>/css/layerslider/css/layerslider.css">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head><!--/head-->
<body id="home" class="homepage">
<header id="header">
<nav id="main-menu" class="navbar navbar-default navbar-fixed-top" role="banner">
<div class="container">
<?php if ( get_theme_mod( 'ahmad_logo' ) ) : ?>
<a class='navbar-brand' href='<?php echo esc_url( home_url( '/' ) ); ?>'
title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'
rel='home' class="navbar-brand">
<img src='<?php echo esc_url( get_theme_mod( 'ahmad_logo' ) ); ?>'
alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'
></a>
<?php endif; ?>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div id="desktpMenu" class="collapse navbar-collapse navbar-left " >
<ul class="nav navbar-nav" >
<?php
echo '<li id="home1" class="scroll "><a href="../#home">Home</a></li>
<li id="section21" class="scroll"><a href="../#section2">about us</a></li>
<li id="Process1" class="scroll"><a href="../#Process">Process</a></li>
<li id="ourStories1" class="scroll"><a href="../#ourStories">Our Partners</a></li>
<li class="scroll "><a href="#">NEWS</a></li>
<li class="scroll "><a href="/faqs">FAQS</a></li>
<li class="scroll "><a href="/contact-us">Contact us</a></li> ';
?>
</ul>
</div>
</div><!--/.container-->
</nav><!--/nav-->
</header><!--/header-->
有什么问题?