WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] is_page() used to disable header image not working on FireFox (8 posts)

  1. 2uh
    Member
    Posted 3 years ago #

    I have suppressed the header image on my photo gallery page, http://thetwobyres.co.uk/photos by using an is_page() condition in my header.php.
    I am using Twenty Eleven and have created a child theme, with the header.php.

    <?php
    // Check to see if the header image has been removed - added the is_page condition
         $header_image = get_header_image();
         if ( ! empty( $header_image ) && (! is_page('photos') ) ) :
    ?>

    This works in Safari and IE, but not in FireFox where the header image still shows up.
    Any suggestions appreciated.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    <?php
    // Check to see if the header image has been removed - added the is_page condition
    	if( !is_page('photos' ) :
    	$header_image = get_header_image();
    	if ( !empty( $header_image ) ) :
    ?>
    [...]
    <?php endif; // end check for removed header image ?>
    <?php endif; // end check for photos page ?>
  3. 2uh
    Member
    Posted 3 years ago #

    Thanks - I tried, couldn't figure out where to add the endifs, kept getting syntax error.
    My code is here, http://pastebin.com/3h2b1kcV - where should I add the two endifs?
    No coding expert.

  4. esmi
    Forum Moderator
    Posted 3 years ago #

  5. 2uh
    Member
    Posted 3 years ago #

    I get a syntax error after pasting your code
    http://pastebin.com/7m2xTzMF

  6. esmi
    Forum Moderator
    Posted 3 years ago #

    Typo! Change:

    if( !is_page('photos' ) : // check for photos page

    to:

    if( !is_page('photos' ) ) : // check for photos page

  7. 2uh
    Member
    Posted 3 years ago #

    Sorry: no syntax error, but the header image on http://www.thetwobyres.co.uk/photos is still enabled in FireFox.

  8. 2uh
    Member
    Posted 3 years ago #

    Must have been the cache - now it seems to work in all browsers.
    Thanks for helping me out!

Topic Closed

This topic has been closed to new replies.

About this Topic