0

My website has only one header. I want to change it with that of Wordpress, for example, because It has an address with a logo at the top and then menu bar.

How can I add that template to mine?

1 Answer 1

1

Use custom header-templates.

create a file for example "header-home.php". Put your code in it and then get it by using <?php get_header('home'); ?>

You can also use header-templates inside a other header-template. Lets say you have the top navigation. You want it in all headers. Then put the code for this in your header.php. Then in for example header-home.php you write:

<?php get_header(); ?> // Loads your header.php
// Some code here

And then in for example your index/home file you put only the code <?php get_header('home'); ?>

3
  • Sorry! I am completely new to wordpress. this is the information in the header php. I wonder how I can add "department of linguistics" at top of my current header.
    – John
    Commented Sep 7, 2015 at 17:01
  • <?php /** * The header for our theme. * * Displays all of the <head> section and everything up till <div id="content"> * * @package Tesseract */ ?><!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_head(); ?> </head>
    – John
    Commented Sep 7, 2015 at 17:01
  • Just use regular HTML/CSS
    – Alex
    Commented Sep 7, 2015 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.