• Resolved elfin

    (@elfin)


    Playing about with this whilst upgrading my plugin. I’ve set a Post thumbnail on a single page, and the thumbnail has replaced the header image (currently using the Forest Floor image).

    Don’t think this is supposed to happen…

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter elfin

    (@elfin)

    then I check the header.php…

    <?php
    if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
      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 } ?>

    erm what? that’s ridiculous! The likely hood of a thumbnail matching the header size for one is unlikely. More importantly Why??

    Very very strange, and I was beginning to like this theme as well.

    The likely hood of a thumbnail matching the header size for one is unlikely.

    actual its not.. the theme will crop any image to the right size if its originally bigger than the header image size, default 940 x 198

    line 39 of functions.php

    // We'll be using them for custom header images on posts and pages
    	// so we want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit)
    	set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );

    Its clearly a design feature of that theme. the header image width/height can be overloaded by filter as well twentyten_header_image_width, twentyten_header_image_height lines 13 & 14 of the functions file.

    Thread Starter elfin

    (@elfin)

    I’m still not convinced, I think many users will be posting about this feature and asking how to amend it.

    me, I created a child theme to remove that functionality ??

    I agree with you that some people won’t want this behaviour, but I think the point is to show case all the new features of wp 3.0 and how they could be used. An option to turn it on and off might be an idea.

    Thread Starter elfin

    (@elfin)

    I’d argue that that is a must have ??

    Thread Starter elfin

    (@elfin)

    I seem to be in the minority about this though, sadly. But hopefully either this thread, or the one in hackers will make someone think about adding in something to make this optional.

    Think it is a great feature, but I’d very much like to see it extended to tags and categories as well, so that one might add a featured image/custom header to those types of pages too.

    I’ve seen a hack somewhere before that I like…

    One biggie for me, is that I use a lot of smaller images that won’t be wide enough to get used…. I think it’d be great if when images that aren’t wide enough are used, they still get used in the header, but are floated…

    but that may just be me, and again….I did see a talk of how to do that somewhere….

    I made a post on how I use post thumbnails with twenty ten, works well for me: https://www.keleko.com/2010/setting-up-post-thumbnails-in-wordpress-3-0-with-twenty-ten/

    dollypower

    (@dollypower)

    I argee with Rich, I think although it is a nice example of what WP can do. I think it’s a odd to have used the thumbnail to implement it. I too would have thought most people would use the “thumbnail” for a smaller image.

    Also, this snippet might be helpful for others, as it will pull in the thumbnail sized thumbnail. If that makes sense!
    <?php the_post_thumbnail('thumbnail'); ?>

    Thread Starter elfin

    (@elfin)

    Since this was posted they changed things, and it now only changes the header if the image is large enough to fill it – which is a lot lot better.

    With child themes you can of course disable the feature it completely.

    Add this to your functions.php

    add_action( 'init', 'mythumbnail_size' );
    
    function mythumbnail_size() {
    
    	add_image_size( 'my-thumbnail', 150, 150 );
    }

    And use this code in your templates
    <?php the_post_thumbnail('my-thumbnail'); ?>

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Post Thumbnail & Twenty Ten theme’ is closed to new replies.