#13671 closed defect (bug) (wontfix)
(TwentyTen) Featured image apparently not working
Reported by: | arena | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
from last nightly build and RC1 or i missed something
Change History (6)
#2
in reply to:
↑ 1
@
15 years ago
Replying to duck_:
Are you sure that you have selected an image with a great enough width? Twenty Ten makes sure the width of the image is greater than HEADER_IMAGE_WIDTH (940px).
will check that !
what is disturbing is that the image appears in the little box 'Featured image' when viewing the post.
#3
@
15 years ago
- Cc mikeschinkel@… added
- Keywords reporter-feedback close removed
- Resolution set to wontfix
- Status changed from new to closed
@arena: My guess is you have tripped over the following problem: #12661
As you can see the decision was made for the featured image to display in the header instead of floating right or left in the post but if it is not the correct width to be a header image then nothing will display at all.
Personally I think that decision will be regretted as it will likely cause no end of consternation and wasted time for users who cannot figure out why it's not working at they expect, similar to your situation. Ironically as it did for me when I gave a presentation to the local WordPress meetup group on new features of v3.0 a few weeks ago. Ironic because I posted #12661 but forgot about it's outcome as I was embarrassingly trying to demonstrate to the audience a great new feature that I the presenter could not get to work!
Fortunately ptahdunbar was in the audience and he pointed out what I had forgotten thus saving that part of the presentation from complete failure. At that point I showed them how to modify their single.php theme template file so that the featured image would appear floating right (or left) at the top of the post exactly as evidently everyone in the audience (including myself) expected.
Your solution? Remove this code from header.php
:
if ( is_singular() &&
has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :
Houston, we have a new header image!
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; ?>
Replacing it with just:
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
And then add this snippet in your single.php
, page.php
and other templates:
<?php echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); ?>
Everyone else's solution? Hopefully they will be lucky enough to find a page like this that explains the problem and not waste too much time or become too frustrated, nor develop a poor opinion of WordPress in the process. :-(
I'm going to close this because this issue was already addressed in #12661 and the resolution was just not to display it if it wasn't the correct size to be a header.
Are you sure that you have selected an image with a great enough width? Twenty Ten makes sure the width of the image is greater than HEADER_IMAGE_WIDTH (940px).