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' );
?>
ok 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!!
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