admin管理员组文章数量:1405736
In header.php I have created a div to contain my navigation menu area. Within the div is 1 x do_shortcode and 2 x includes php files. For some reason the last include ('custom-primary-menu.php')
is skipping <header id="masthead"
and <div id="page" class="hfeed site">
and is only within <div class="col-full">
. The other 2 however, appear as they should.
I thought it might have something to do with the open div at the end of the code which is also "col-full" but I tried renaming the first and it made no difference.
<?php
?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
<link rel="profile" href="">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'storefront_before_site' ); ?>
<div class="col-full">
<div id="page" class="hfeed site">
<?php do_action( 'storefront_before_header' ); ?>
<header id="masthead" class="site-header" role="banner" style="<?php storefront_header_styles(); ?>">
<?php
do_action( 'storefront_header' );
?>
<?php
echo do_shortcode ('[woo_multi_currency_layout5]');
include ('secondary-icon-menu.php');
include ('custom-primary-menu.php');
?>
</header><!-- #masthead -->
</div>
</div>
<?php
do_action( 'storefront_before_content' );
?>
<div id="content" class="site-content" tabindex="-1">
<div class="col-full">
<?php
do_action( 'storefront_content_top' );
?>
In header.php I have created a div to contain my navigation menu area. Within the div is 1 x do_shortcode and 2 x includes php files. For some reason the last include ('custom-primary-menu.php')
is skipping <header id="masthead"
and <div id="page" class="hfeed site">
and is only within <div class="col-full">
. The other 2 however, appear as they should.
I thought it might have something to do with the open div at the end of the code which is also "col-full" but I tried renaming the first and it made no difference.
<?php
?><!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2.0">
<link rel="profile" href="http://gmpg/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php do_action( 'storefront_before_site' ); ?>
<div class="col-full">
<div id="page" class="hfeed site">
<?php do_action( 'storefront_before_header' ); ?>
<header id="masthead" class="site-header" role="banner" style="<?php storefront_header_styles(); ?>">
<?php
do_action( 'storefront_header' );
?>
<?php
echo do_shortcode ('[woo_multi_currency_layout5]');
include ('secondary-icon-menu.php');
include ('custom-primary-menu.php');
?>
</header><!-- #masthead -->
</div>
</div>
<?php
do_action( 'storefront_before_content' );
?>
<div id="content" class="site-content" tabindex="-1">
<div class="col-full">
<?php
do_action( 'storefront_content_top' );
?>
Share
Improve this question
asked Dec 3, 2019 at 13:39
aye ceeaye cee
15912 bronze badges
4
|
1 Answer
Reset to default 0ok after days of doing the same thing over and over...menting out different combinations of files...I realised the problem was actually an extra closing div which the code editor threw in for me in one of the files!!
本文标签: phpcode is skipping a div
版权声明:本文标题:php - code is skipping a div 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744931812a2632948.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
echo
ing instead ofreturn
ing. You might try either echoing all, or returning all, to see if making them all the same puts them all in the same place. – WebElaine Commented Dec 3, 2019 at 15:44