• I’ve just added a second custom page to a local site, and it’s showing two headers with a navigation menu and image on top of each other.

    I searched the file for get_header(), and there’s only one. The other page that uses get_header() only shows one header.

    The next possibility would be the html code that displays the header is duplicate. The div that contains the header html has an id of “header”. I searched the file for that as well, but only found one “id=header”, not two.

    So what could it be that results in two headers if not the header code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • What type of page are you trying to load? Due to the way WordPress loads templates, it is possible that it is using two templates via get_template_part, and both of them have a call to get_header. (i.e. content-single.php).

    The ID is simply used when styling the header, so that shouldn’t be the problem. When you look at the html, does it show the same div’s with duplicate content? i.e Navigation, php echo esc_url, bloginfo, etc.?

    Thread Starter warning

    (@warning)

    It’s a regular custom page template page, selected under ‘pages’. It was created the same way as the other page with only one header showing. Their html is very similar.

    Yes, the browser source code shows two id “header” divs with navigation menus. Problem is I see just one header in the text editor.

    EDIT:

    My bad, posting it here helped me see it. I had forgotten to remove the header html from the new page – it’s already contained in header.php. Thanks for trying to help thou.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom page displays two headers stacked’ is closed to new replies.