Community Forums › Forums › Archived Forums › General Discussion › Custom header for Date/home pages not loading once migrated
Tagged: Custom header, live site migration, page template
- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by
Jeffreydotfong.
-
AuthorPosts
-
May 18, 2016 at 4:15 am #185819
Jeffreydotfong
MemberHi There, I'm using genesis.
I recently migrated my site to a live server at http://testing.fastpackjournal.com/journal/. I built it offline and used MAMP. My "Journal" or blog home page had a custom header which I named "header-Home.php". I used this code successfully in Home.php (on my locally hosted site) to load the custom header...
add_action('genesis_header', 'load_home_page_header'); function load_home_page_header() { get_header('Blog_home'); }However, once I migrated the site live to bluehost, the Home.php index loads but NOT the header. It defaults to my header-index.php. It cannot call any other headers so it it not a header file issue. This exact call is working on my Single.php file, so I can't see how it is a code error.
How can I get my live site to load custom headers on the index pages?
http://testing.fastpackjournal.com/journal/May 18, 2016 at 5:56 am #185825Victor Font
ModeratorDid you first remove the standard Genesis header?
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 ); remove_action( 'genesis_header', 'genesis_header_markup_close', 15 ); remove_action( 'genesis_header', 'genesis_do_header' );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?May 18, 2016 at 6:04 am #185826Jeffreydotfong
MemberHi Victor,
Yes, I have that exact code.
The strangest bit is that it works on my locally hosted site, but not on the live server!
Jeff
May 18, 2016 at 6:40 am #185830Victor Font
ModeratorWhat's the actual name of the template file? Your local installation may not be case sensitive whereas the production server is. With the parameter you're passing to the get_header function, it will be trying to load header-Blog_home.php. Make sure the spelling is exact.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?May 18, 2016 at 3:05 pm #185867Jeffreydotfong
MemberHi Victor,
The file names were exact. I neglected to mention that I had a custom index header. I have solved the issue with this code in my index.php:
// Header for home and index pages singled out... add_action('genesis_header', 'load_project_page_header'); function load_project_page_header() { if (is_home() || is_date()) { get_header('Blog_home'); } else { get_header('index'); } }Thanks for your help! Seems to be an issue with my installation of wordpress though.
Jeff
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.