Forums

Can header be smaller in height than my home static page? (5 posts)

  1. jmb597
    Member
    Posted 5 months ago #

    Hi, I am using the Twenty Eleven theme. I created a new page and called it home and changed the settings for it to be the front page.

    Now that I've done that, when any other page is clicked on, I want the header to be smaller in height and changed to the chosen header image for that page. I've looked around and found how to change the images according to the page, but nothing about changing sizes...im sure it's because all of the pages are using the same functions and template.

    Is there a way to create a new page template (I saw a tutorial about this too, but couldn't understand how to resize the header) that I can assign to those pages, that will call a different header function or style sheet (I don't know what I'm talking about...I just know the functions.php file has the headers image size in it and don't know how to make it a separate function)? This may be a super loaded question and if it is...I am really sorry!

    Any help would be appreciated!! Thanks!!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. Create a child theme for your changes. Once your child theme is active, we should be able to help with the customisation.

  3. jmb597
    Member
    Posted 5 months ago #

    OH yes, forgot to mention that I did create a child theme...thanks!!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    You need to use an amended header.php template file in your child theme. You need to amend this section:

    <?php // The header image
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    else : ?>
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    <?php endif; // end check for featured image or standard header ?>
  5. jmb597
    Member
    Posted 5 months ago #

    Hi Esmi! Thanks for getting back to me! So, I pasted that in my functions child theme...but not sure how to ammend it. Where do I post which page it is, where the graphic can be called from and the size of the graphic?

    I'm sure I have to do multiple lines as well as I have 4 pages to change the graphic and the size. Sorry...I'm such a newbie.

    if it helps...this is the site http://www.gooddoggreatdog.com/wordpress1 the picture is how it should be on the home page, but when someone presses, let's say, 'Programs' or whatever, I want the picture to be smaller in hieght (right now its 928 x 444 and I will want it down to 928 x 250) AND a new picture that will match that size. Thanks!!

Reply

You must log in to post.

About this Topic