I have been trying to find some sort of guide or tutorial for the post thumbnail feature that was implemented in 2.9. I know very little php or programming and the documentation seems incomplete or the forum posts seem very vague.
I'm using the latest Development release at http://developing.thematic4you.com/thematic-development-release/ and I'm creating my own child theme.
A note which may help others:
- Post Thumbnail image that you see in some tutorials around the web is really called "Featured Image" when you try to add a new post (bottom right hand side). They've renamed this from 2.9 -> 3.0, and I wish they just left it alone to avoid confusion!
So I still don't know how to hook this get_the_post_thumbnail() into the post.
All I want to do is have the post thumbnail appear before the first word of the post (like the body of the post). Like this: After the title, after the meta, POST THUMBNAIL, the text of the post, the footer meta.
I just want to put this "Bulletproof" check for backwards compatability too:
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) {
the_post_thumbnail();
} else {
$postimage = get_post_meta($post->ID, 'post-image', true);
if ($postimage) {
echo '<img src="'.$postimage.'" alt="" />';
}
}
I found this on the forums:
add_theme_support( 'post-thumbnails' );
function my_post_title($title) {
return get_the_post_thumbnail(NULL, 'thumbnail') . $title;
}
add_filter('thematic_postheader_posttitle', 'my_post_title');
Which I changed to:
add_filter('thematic_postheader_postmeta', 'my_post_title');
Which is the exact position where I want it, but in the markup, it's contained in a different <div>. I tried hooking or filtering or add action'ing to the thematic_post(), but that wipes the body of the post out and just displays the image. :(
Frustrating! I've spent 3+ hours on this problem. I still don't have a good solution. Please help!