This topic has 9 replies, 2 voices, and was last updated 10 years by Boblebad.

  • Author
  • #13249
     Boblebad
    Participant

    Hi

    I’m trying to figure out how to have a header on the home/front page whitout the little logo up left, cause i have a big logo below header on the page.

    On all the other pages i don’t want the big logo, therefor i need the little logo in the header again.

    What’s written about it on the WordPress codex pages does not work: http://codex.wordpress.org/Function_Reference/get_header

    No matter what i do, i can’t get the get_header to fetch header_main.php.

    My big logo is put in home-register-form.php, cause that’s what i have on my home/front page, and that way i can keep from the other pages.

    When using include, i can get header_main to display, but the selection does not work. i get an error: http://www.wprecipes.com/how-to-use-multiple-custom-headers-on-a-wordpress-theme

    All the best
    Carsten

    #13250
     Boblebad
    Participant

    I found a way to do this 🙂

    But it’s through the template files, front-page.php, they get overwritten when updating.

    And still get_header does not work, why is that, it works with include ?

    ‘include(TEMPLATEPATH.’/header_main.php’);’

    Is there a way to get this to work, so i don’t loose changes when updating ?

    #13252
     Boblebad
    Participant

    I found out why i got errors with the previous code.

    <?php
    if (is_page('home')){
    include(TEMPLATEPATH.'/header_main.php');
    }
    elseif (is_page('gallery')){
    include(TEMPLATEPATH.'/headergallery.php');
    }
    else {
    include(TEMPLATEPATH.'/header.php');
    }
    ?>

    http://stukinabox.com/use-multiple-custom-headers-on-your-wordpress-theme/

    But i still can’t get the selector working, even if i use the page ID from home: 837, whitout the ‘ ‘, it still won’t give me another header.

    I use the index.php in the main Sweet Date theme.

    #13363
     Abe
    Keymaster

    You should try is_front_page() instead of is_page(‘home’)

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #13381
     Boblebad
    Participant

    That does not work, gives an error.

    “Parse error: syntax error, unexpected ‘is_front_page’ (T_STRING), expecting”

    #13384
     Boblebad
    Participant

    Reading around gives me the impression that this can not be done this way.

    “The is_front_page() It returns TRUE when the main blog page is being displayed and the Settings->Reading->Front page displays is set to “Your latest posts”, or when is set to “A static page” and the “Front Page” value is the current Page being displayed.”

    And the is_front_page(), has to be sorrounded by ( ) as (is_front_page()), then the error goes away, but it still does not select the right header for the front page, but in some way it seams that the selector is working, cause when switching the two headers, i can se on the blog page, that the logo is removed.

    So what page is it that the selector needs to check for as the front page ?

    EDIT: Hmm, it’s only working for the blog page, all the other pages has the logo, so in some this isn’t working at all as it’s supposed to

    #13649
     Boblebad
    Participant

    Anyone knows how to make this work ?

    And in addition: How do i select a special header for smart phones ?

    #13694
     Abe
    Keymaster

    You can change the front page template wp-content\themes\sweetdate\page-templates\front-page.php and just change the header in that since it addresses only to home page

    You can always hire a programmer to help you with that since he will do those changes in no time if you don’t have programming knowledge

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #13758
     Abe
    Keymaster

    To detect mobile phones you will need some custom scripts also

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #15714
     Boblebad
    Participant

    Found out hat was wrong, this is the way to do it 🙂

    —–
    Using get_header() will call the standard header.php template file; now, if you rename your headerwide.php file to header-wide.php (note the hyphen after ‘header’) you can call it with get_header( ‘wide’ )
    —–

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Multiple headers ?’ is closed to new replies.

Log in with your credentials

Forgot your details?