• Hi,

    I was wondering how to have the header image only on my homepage, and remove it from all other pages.
    Within my header.php file, I have

    <div class="container">
    <div class="container-inner">
    
    	<?php if ( get_theme_mod( 'header_image' ) ) : ?>
    	<div id="header-image">
    	<img src="<?php header_image() ?>" width="950" height="200" alt="" />
    	</div>
    
    	<?php endif; ?>

    I’ve tried changing it to <?php if (is_home):?> etc. but that wasn’t working.

    Here is my site

    Can anyone help me out?

Viewing 3 replies - 1 through 3 (of 3 total)
  • seems you get the wrong function..

    if( is_home() ):
    // your header section
    endif;

    just don’t change anything, put your header section between

    those if and endif..

    Thread Starter cobweb141

    (@cobweb141)

    Sorry, I don’t completely understand, there doesn’t seem to be an if(is_home() ): function in the header.php file.

    you said that..

    I’ve tried changing it to <?php if (is_home):?> etc. but that wasn’t working.

    first don’t change anything but by adding them after

    and before the header function.. and second what

    function to be added is is_home function but seem

    you get wrong function.. is has to be like this..

    if( is_home() ):
    // your header section
    endif;
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Remove header image from static pages’ is closed to new replies.