Where did you add this code in the child theme? Do you have a custom copy of the header.php file in your child theme? That’s where the “featured image banner” code is.
The code was added into content.php directly below the header code.
I haven’t created a header.php file yet in my child theme. What would I need to do to the code in order to prevent the “featured image banner” feature?
to show a thumbnail per post on the front page in a Twenty Eleven child, you can simply edit content.php (in the child theme) and add
<?php the_post_thumbnail('thumbnail'); ?>
into the existing code;
for instance after this line 34:
</header><!-- .entry-header -->
or for a conditional and linked thumbnail:
<?php if( has_post_thumbnail($post->ID) ) { ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<?php } ?>
http://codex.wordpress.org/Function_Reference/the_post_thumbnail
http://codex.wordpress.org/Function_Reference/has_post_thumbnail
(obviously this will only show if the post has a ‘featured image’)
Way to go alchymyth! Worked like a charm.
One other question though. How can I move the text to the right of the featured image?
Also, if you’re up to it, I’m still looking for assistance on getting rid of the featured image banner.
Thanks for the help guys.
Hey guys. After much googling I could still use some help on getting rid of the featured image banner, and also wrapping text around the featured image on the front page.
try to add this to style.css of the child theme:
.home .attachment-thumbnail { float: left; margin: 25px 10px 10px 0; }
.home
restricts this style to the posts page; and .attachment-thumbnail
targets the post-thumbnail image.
for the featured header banner, edit header.php and look closely at this well commented section (shortened below):
<?php
// The header image
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
.....
.....
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 ?>
remove most of it and leave only this part:
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
Oh man, someone give this man a medal.
Thanks alchymyth, all 3 of your solutions have saved me a ton of time. I really appreciate it.