Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi, I’m Tiny Framework author. Are you using any specific plugin for the header? The reason you get some of the pictures as header images is because:

    1. You set them as featured image for that particular post, and:
    2. It matches the specific size that is set (can be adjusted) in functions.php.

    So for Tiny Framework the size is 960px. If you want that featured image appear in the header, make sure it is at least 960px wide.

    If you want to change the behavior/image required width, please see this in child theme’s functions.php:

    2.3 – Tip07 – Add new image size for custom post/page headers and select default header image.

    Hope that helps 😉

    Your website looks very good, the only thing I would say, you might want to try removing border from product photos and see if you like it better, to me it would look cleaner:

    http://mtomas.com/389/tiny-forge-framework-child-themes-comprehensive-guide#Images-disable-border

    If you will have more questions, please them to a theme support:

    https://wordpress.org/support/theme/tiny-framework

    Thanks!

    Hi Tomas,

    I have tried changing the code at 2.3 – Tip07 and for some reason the theme doesn’t recognize that I changed it. I have it set to 1000 wide by 137 tall.

    Did you uncommented the whole block first? This is code from my other child theme:

    function tinyframeworkchild_custom_header_setup() {
    	// Set custom default header. Uncomment if you need to change height and width, name, etc.
    
    	$args = array(
    		// Set height and width, with a maximum value for the width.
    		'height'           => 450,
    		'width'            => 1600,
    		'max-width'        => 2000,
    		// 'default-image' => get_stylesheet_directory_uri() . '/images/headers/my-header.jpg',
    	);
    	add_theme_support( 'custom-header', $args );
    
    	// Add new custom image size, so later you could call it in the theme. Unique image name should be specified, eg. custom-featured-image-small, custom-header-image-large, etc.
    	add_image_size( 'custom-header-image-large', 1600, 9999 ); // 1600 pixels wide (and unlimited height)
    }
    add_action( 'after_setup_theme', 'tinyframeworkchild_custom_header_setup' );

    This is mine

    /**
    * 2.3 – Tip07 – Add new image size for custom post/page headers and select default header image.
    *
    * $args in add_theme_support() in child theme will auto override what defined in parent’s.
    *
    * @link https://core.trac.wordpress.org/browser/tags/3.5/wp-includes/theme.php#L1292
    * @link https://wordpress.stackexchange.com/questions/108572/set-post-thumbnail-size-vs-add-image-size
    */

    function tinyframeworkchild_custom_header_setup() {
    // Set custom default header. Uncomment if you need to change height and width, name, etc.

    $$args = array(
    ‘width’ => 1000,
    ‘height’ => 140,
    ‘default-image’ => get_template_directory_uri() . ‘/images/header.jpg’,
    );
    add_theme_support( ‘custom-header’, $args );

    // Add new custom image size, so later you could call it in the theme. Unique image name should be specified, eg. custom-featured-image-small, custom-header-image-large, etc.
    // add_image_size( ‘custom-header-image-large’, 1600, 9999 ); // 1600 pixels wide (and unlimited height)
    }
    add_action( ‘after_setup_theme’, ‘tinyframeworkchild_custom_header_setup’ );

    Try also to copy header.php from main theme to child and change this line:

    echo get_the_post_thumbnail( $post->ID, 'custom-header-image', array(

    to

    echo get_the_post_thumbnail( $post->ID, <strong>'custom-header-image-large'</strong>, array(

    And then you can regenerate all thumbnails with the Regenerate thumbnails plugin:

    https://wordpress.org/plugins/regenerate-thumbnails/

    You could avoid including header.php, in this case you would not specify new image size, so you would not need these lines:

    // Add new custom image size, so later you could call it in the theme. Unique image name should be specified, eg. custom-featured-image-small, custom-header-image-large, etc.
    // add_image_size( ‘custom-header-image-large’, 1600, 9999 ); // 1600 pixels wide (and unlimited height)

    When I replaced the header.php section in my child theme the website broke. I had to put it back the way it was. I added in the other line to the functions.php but nothing has changed. I also regenerated all the thumbnails using the plugin you suggested.

    Please also remember that original picture has to be 1000px in your case, because for example:

    http://accentmusicalinstruments.com/accent/wp-content/uploads/2014/05/HR945GD-e1475514221399.jpg

    is only 950px. So you would have to upload new images that fit dimensions.

    Overall I think you don’t need to use 1000px width, as those pictures will be resized in the theme, as it is now. You can right-click on the header and you will see it will show something like:

    View post on imgur.com

    To take advantage of wider image you would have to resize whole theme, but that is much more involved process:

    http://mtomas.com/389/tiny-forge-framework-child-themes-comprehensive-guide#Make-whole-site-wider-or-narrower

    So in your case I would not change anything, just use images wider than 960px, make them featured and you will be good, otherwise, if you want to enforce uniform header size, change only height of the image.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Header Image’ is closed to new replies.