Forums

Get_Header("custom header") (3 posts)

  1. arimdallas
    Member
    Posted 4 months ago #

    Hello World!

    I am an amatuer web designer trying to make my own WP theme.

    I want to make a custom header template for my homepage. I have made a header_home.php file. In home.php, I have a simple line that says, <?php get_header_home; ?> I have also tried doing this <?php get_header ("header_home") ?>. Neither seems to call the new header template. Any suggestions on where I;ve misunderstood template files?

    Email is best for me if possible: [email moderated - this forum does not provide support via email]

  2. alchymyth
    The Sweeper
    Posted 4 months ago #

    when unsure how to use WordPress functions, read the Codex:

    http://codex.wordpress.org/Function_Reference/get_header

  3. arimdallas
    Member
    Posted 4 months ago #

    Hey Ari, this is yourself responding to your own question. Congratulations on finally figured out this Son of a "better left unsaid." So here is deal boys are girls and geeks of all ages. If you are "dumb" like I am and are trying to teach this stuff to yourself and only have this crazy mess of blogs through perhaps this will save you the 3 or so hours I have spent going insane.

    When using the get_header function, wp catergorizes your custom headers in special way. Let's say you want to create a header for your home page, a header for your blog page, and a header for your content pages. You could title them respectively:

    header-homepage.php

    header-blog.php

    header-content.php.

    When you are using the get_header function you would call the your custom headers like this:

    get_header ( "homepage" ), get_header ( "blog" ). get_header ( "content").

    IN OTHER WORDS AND WHAT REALLY F-ED ME UP: YOU DON'T PUT THE HEADER PART AGAIN INSIDE THE " ". YOU ONLY PUT THE NAME LIKE, "blog", "content", "homepage", or whatever name you want. IN OTHER OTHER WORDS:

    NAME OF PHP HEADER: header-customheader.php

    HOW TO WRITE IT:

    YES: get_header ( "customheader" )

    NO: get_header ( "header-customheader" )

    NO: get_header ( "header-customheader.php" )

    NO: get_header ( "customheader.php" )

    NO: anything else

Reply

You must log in to post.

About this Topic