-
Author
-
March 22, 2014 at 22:04 #13249BoblebadParticipant
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
CarstenMarch 22, 2014 at 22:17 #13250BoblebadParticipantI 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 ?
March 22, 2014 at 22:54 #13252BoblebadParticipantI 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.
March 24, 2014 at 16:53 #13363AbeKeymasterYou 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.March 24, 2014 at 20:33 #13381BoblebadParticipantThat does not work, gives an error.
“Parse error: syntax error, unexpected ‘is_front_page’ (T_STRING), expecting”
March 24, 2014 at 22:45 #13384BoblebadParticipantReading 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
March 27, 2014 at 23:42 #13649BoblebadParticipantAnyone knows how to make this work ?
And in addition: How do i select a special header for smart phones ?
March 28, 2014 at 23:10 #13694AbeKeymasterYou 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.March 29, 2014 at 03:21 #13758AbeKeymasterTo 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.April 23, 2014 at 11:18 #15714BoblebadParticipantFound 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’ )
—– -
AuthorPosts
The topic ‘Multiple headers ?’ is closed to new replies.