- This topic has 11 replies, 3 voices, and was last updated 10 years, 3 months ago by
Tom.
-
AuthorPosts
-
December 28, 2015 at 4:42 pm #162252
Christa Hutchins
At the top of all my pages, I have the nav bar, then a header that is only an image loaded as the logo, then a “below the header” hook with my subscriber bar and social icons. I would like to have the current header/logo image on the home page and a different image in that space on all the other pages and posts. What is the best way to do this?
Site is wwww.doanewthing.com
Thanks!
December 29, 2015 at 12:32 am #162280Tom
Lead DeveloperLead DeveloperHi there,
This method may help: https://generatepress.com/forums/topic/change-site-header-and-title-based-on-page/#post-111841
Let me know 🙂
December 29, 2015 at 4:16 am #162299Christa Hutchins
Pretty sure I copied your directions exactly, but that didn’t work. I left it so you can see what happened. It put both headers on the Home page.
December 29, 2015 at 10:34 am #162347Tom
Lead DeveloperLead DeveloperYou’ll need to remove the logo from “Customize > Site Identity” as you’ve added it using GP Hooks.
December 29, 2015 at 10:47 am #162355Christa
Wait … I thought I was adding the custom_header using the hook. If it didn’t find the custom_header on a page, it would add the default. The pages without custom_header defined are showing only the default, which is what I want. The home page is showing both the default and the custom when I only want the custom. Did I misunderstand what we were doing?
December 29, 2015 at 10:49 am #162356Tom
Lead DeveloperLead DeveloperNo you’re right, but it looks like you still have a header added via “Appearance > Customize > Site Identity”, which is why it’s showing twice.
Have you checked to see if your logo is added in that area still? If it is, remove it and everything should work.
December 29, 2015 at 10:56 am #162363Christa
I do have the pretty image as the logo. If I don’t define it there, how will it know to use that image instead of the custom one on pages where it doesn’t have custom_header? I don’t specify that image anywhere else
December 29, 2015 at 10:57 am #162364Tom
Lead DeveloperLead DeveloperYou define it in this part of the code:
<?php else : ?> <img src="URL TO MY DEFAULT LOGO" alt="" /> <?php endif; ?>December 29, 2015 at 10:59 am #162365Christa
Duh! I missed that part! It still says “URL TO MY DEFAULT LOGO” Ha ha!!
December 29, 2015 at 11:00 am #162366Tom
Lead DeveloperLead DeveloperOnce that’s updated and your logo in the Customizer is removed you should be good to go 🙂
December 29, 2015 at 11:17 am #162371Christa
It works! I need to play around with the size/spacing/padding of the pretty image …. I don’t want the white space around it, but it’s basically right. Thanks so much!
December 29, 2015 at 11:22 am #162372Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.