Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using the latest default Twenty Eleven on WordPress 3.3.1

My Site Currently

My post has a featured image (the smaller one, which 1 is pointing to), and I would like it not to appear in my post. It has already appeared in my outer post before someone clicks in.

In the picture above, I also point to 2, which shows up in a lightbox but that has been turned off, so please ignore that.

I would appreciate help on removing the displaying featured image on my posts. Thanks!

share|improve this question
    
Have you looked in the code at all? –  m0r7if3r Feb 11 '12 at 18:39
    
It looks as though you have the image placed using the featured image and also have it placed inside the post itself. Pick which one you want to keep and remove the other (if that's the case)? –  Jeremy Jared Feb 11 '12 at 18:50
    
what plugin(s) are you using? afaik, Twenty Eleven only uses the post_thumbnail for the header image. –  Michael Feb 11 '12 at 20:20
    
I have tried looking at the code (but I am new to this), and commented out add_theme_support( 'post_thumbnails' ); myself, and it is still the same result. I have to use the featured image in order for it to appear outside of my post, so the alternative is to hide it inside the post :( I am using "MarketPress Lite" plugin. –  CyberMew Feb 12 '12 at 4:12
add comment

2 Answers

TwentyEleven includes the featured image from header.php, rather than a template part like most themes. If you comment out line 92 that should remove it, e.g.

<?php
    // The header image
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() &&
            has_post_thumbnail( $post->ID ) &&
            ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) &&
            $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; // end check for featured image or standard header ?>

However, it'd be better to create a child theme and place your modified version of header.php inside it.

share|improve this answer
    
Hi, I have tried commenting out "echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );" but the results appear to be still the same though :( –  CyberMew Feb 12 '12 at 4:14
add comment

After some time digging blindly, looks like I found out how to solve it. It wasn't the theme's fault.

I simply fixed it by going into /wp-content/plugins/wordpress-ecommerce/marketpress.php

Went to function product_theme($content)

and commented out the line 1411:

//add thumbnail
//$content = mp_product_image( false, 'single' ) . $content;

Tada!

share|improve this answer
    
And you cannot update the plugin anymore. Ask the authors for a filter you can use instead. That’s much better. –  toscho Feb 12 '12 at 12:50
    
They only respond to paid members, so I guess I am out of luck on that front. If not for the fact that it is simple and straightforward plugin, I won't even want to use it. But why won't it update if just one line is commented out? –  CyberMew Feb 12 '12 at 13:33
    
After an update your change is lost. You have to re-add it after each update. I’m sure they’ll listen to suggested improvements. –  toscho Feb 12 '12 at 14:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.