• Hi All,

    I have created a second custom header for my website

    `<?php get_header( ‘header-landing’ ); ?>’

    The only difference between this header and the original is the hero background image has changed, I’ve created a new BG class to suit however the new header does not display and shows the original header. I’ve cleared caches nothing works, very frustrating, there is nothing wrong with my code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • What did you call the file? Based on your code WordPress is looking for header-header-landing.php. If your file is header-landing.php then the code should be get_header( 'landing' );.

    • This reply was modified 3 years, 2 months ago by Jacob Peattie.
    Thread Starter maccready

    (@maccready)

    Hi Jacob,

    Incredible I can’t believe I missed such an obvious error! Many thanks for your help ?? Slightly embarrassed so will toddle off now. Cheers ??

    If you’re file is named header-landing.php, should you jusy be passing the word landing into the get_header? Like this,
    get_header(‘landing’);

    Also, make sure your file is in the root of the child theme.

    Thread Starter maccready

    (@maccready)

    Resolved. Many thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom header.php not working.’ is closed to new replies.