WordPress.org

Ready to get started?Download WordPress

Forums

WPstart
[resolved] Header image (3 posts)

  1. jwwalker
    Member
    Posted 7 months ago #

    How do I keep the header image from displaying on every page. I only want the header on the front page.
    Thanks for you help.

  2. krusze
    Member
    Theme Author

    Posted 5 months ago #

    Hey. In content-extensions.php find this:
    <?php $header_image = get_header_image();
    if ( ! empty( $header_image ) ) : ?>
    <img src="<?php echo esc_url( $header_image ); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" class="header-image" />
    <?php endif;

    and change to:

    <?php $header_image = get_header_image();
    if ( ! empty( $header_image ) && is_front_page() ) { ?>
    <img src="<?php echo esc_url( $header_image ); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" class="header-image" />
    <?php }

  3. krusze
    Member
    Theme Author

    Posted 4 months ago #

    Hope this one abobe helped you.
    Marked as resolved.

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.