• Resolved billy1983

    (@billy1983)


    Hi,
    i am trying to make the header image only display on the homepage. so what i have done is to create a duplicate the header.php file and i have created a new template also. what i am struggling with is the get_header(); function call at the top of the php page. can someone tell me what javascript file the get_header() function is in so i can duplicate it. or tell me how i can do it another way.
    Many thanks
    Billy

Viewing 3 replies - 1 through 3 (of 3 total)
  • use names, and call the homepage header using it’s name :
    get_header( $name );
    read about it in codex
    i tried to apply it but unfortunately my theme does not support custom headers ..

    It sounds like you already created a child theme? If so, just copy the header.php from the parent theme’s folder to your child theme’s folder.

    Find this code in the header.php file:

    <div class="header-image">
    	<?php $header_image = get_header_image();
    		if ( ! empty( $header_image ) ) { ?>
    			<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    				<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
    			</a>
    		<?php } // if ( ! empty( $header_image ) ) ?>
    	</div>

    and replace it with:

    <div class="header-image">
    	<?php
    		if (is_front_page()) {
    			$header_image = get_header_image();
    			if ( ! empty( $header_image ) ) {
    			?>
    				<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    					<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
    				</a>
    			<?php
    			}
    		}
    	?>
    	</div>

    You don’t need to worry about the get_header() function. It’s not involved with the header image.

    Theme Author Template Express

    (@danstriker)

    thanks linux that should indeed do the trick

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get_header();’ is closed to new replies.