我正在努力使自己的网站基于WordPress和我发现真的很好的主题(范木灯),但我需要移动“导航”或标题下的菜单。当我这样做的时候,我的身体只是向右移动,我不知道发生了什么。
在免费的虚拟主机上有一个网页:http://stbrezenecka.wz.cz/ (捷克语)
这是我的header.php:
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package Fanwood Light
* @since Fanwood Light 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'before' ); ?>
<header id="masthead" class="site-header" role="banner">
<hgroup>
<?php
$header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
</a>
<?php } ?>
<div class="header">
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</div>
</hgroup>
</header><!-- #masthead .site-header -->
<div id="main-navigation">
<nav id="site-navigation" class="navigation-main" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'fanwood_light' ); ?></h1>
<div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'fanwood_light' ); ?>"><?php _e( 'Skip to content', 'fanwood_light' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- .site-navigation .main-navigation -->
</div>
<div id="page" class="hfeed site">
<div id="main" class="site-main">
屏幕截图:http://i.stack.imgur.com/CtAT8.png
发布于 2015-02-01 22:15:08
您有创建<div>的<?php do_action( 'before' ); ?>,因此在</header>之后添加</div>
发布于 2015-02-02 00:44:46
是的我做到了!我所做的唯一一件事是,我刚刚从header.php中删除了导航,并转移到index.php中,并且它起作用了。
https://stackoverflow.com/questions/28263607
复制相似问题