WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
[resolved] [closed] Twenty Twelve Featured Image Showing up twice (24 posts)

  1. Pratyush Mittal
    Member
    Posted 1 year ago #

    I am migrating from Twenty Eleven to Twenty Twelve, and suddenly the featured images shows twice in the index page as well as in the post.

    Any easy way to solve it?

    Thanks.

    http://wordpress.org/extend/themes/twentytwelve/

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    I've just tested with Twenty Twelve and I can't reproduce this issue.

  3. Pratyush Mittal
    Member
    Posted 1 year ago #

    From one of my test blogs: http://codewordz.com/android/fonedanz-cinemagraph-alternative-for-android/

    The GIF (featured image) is shown twice on top (and also shown twice on the index).

  4. Pratyush Mittal
    Member
    Posted 1 year ago #

    Steps for reproduction:

    Upload image by selecting "Add media"
    Click "Use as featured image"
    Click "Insert into post"
    Save and publish

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    I still can't replicate the issue.

  6. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    Click "Use as featured image"
    Click "Insert into post"

    no wonder you have the image twice;
    just do only one of those actions - either add the image into the post, or use it as 'featured image'.

    Twenty Twelve outputs the featured image above the post title:

    code from content.php:

    <header class="entry-header">
    			<?php the_post_thumbnail(); ?>
  7. stargiss
    Member
    Posted 1 year ago #

    I had this problem too. I just deleted it from the 'Featured Image'. I used "Use as Featured Image' and 'Insert In Post' on Twenty Eleven and didn't have this problem but this new theme is different. Just insert into post and don't bother with Featured Image.

  8. Morten Rand-Hendriksen
    Member
    Posted 1 year ago #

    Like @alchymyth said, the image appears twice because it is inserted twice. This is a common issue with themes that use featured images. To work around it I usually use the Image post format as an indicator whether I want the featured image to show up in single post view or not. If the Image post format is on, the featured image shows up, if it's not on the featured image does not show. But that's my solution.

    @stargiss: The reason you didn't see the same effect in Twenty Eleven is because in Twenty Eleven the featured image for single posts was hooked to the header image, and even then it only kicked in if your image was wide enough to fit in the header.

  9. Pratyush Mittal
    Member
    Posted 1 year ago #

    @mor10: Thanks for the workaround and the explanation about the internals of Twenty Eleven. That sounds fair enough.

    Any simple tips to remove featured image (without deleting the image from post) for all the posts?

  10. Morten Rand-Hendriksen
    Member
    Posted 1 year ago #

    @Pratyush: If you want to take away the featured image in one of the templates I recommend you create a child theme and then copy over whatever templates you don't want the featured image to appear in into your child theme folder. Then all you have to do is find the function that inserts the featured image (looks something like this: <?php the_post_thumbnail(); ?> ) and comment it out or delete it all together. By doing this in your child theme you avoid accidentally causing damage to the main theme and you can experiment to see what works and what doesn't. Make sense?

  11. Pratyush Mittal
    Member
    Posted 1 year ago #

    Thanks @mor10, it does make sense. Will give creating child theme a try.

  12. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    Any simple tips to remove featured image (without deleting the image from post) for all the posts?

    I posted the code already in my first reply two days ago -

    edit a copy of content.php in your child theme and remove:

    <?php the_post_thumbnail(); ?>

    or comment it out, like so:

    <?php // the_post_thumbnail(); ?>

  13. Pratyush Mittal
    Member
    Posted 1 year ago #

    I was actually looking for some simple SQL command or something (like a plugin to bulk remove featured images from selected posts) to remove the featured images on the database end itself.

    As @mor10 pointed out, that it is an issue with most themes providing featured image option. Thus solving it at database end would solve it for all the themes. Also, it makes it easier later when the theme patches are released.

    Thanks.

  14. esmi
    Forum Moderator
    Posted 1 year ago #

    Where's the issue? As suggested by mor10, just create a child theme that doesn't use the_post_thumnbnail() or any related functions.

  15. Morten Rand-Hendriksen
    Member
    Posted 1 year ago #

    I agree with @esmi. Post thumbnails is not an issue - it's a great feature in fact and it interacts well with sharing sites like Google+ and Facebook. The implementation of featured images often leaves something to be desired though. I wouldn't write them off by removing them from the database. Telling your theme not to display them is a much better option. They don't do any damage sitting in the database.

  16. riprowan
    Member
    Posted 1 year ago #

    Agree with esmi and mor10. It's useful to be able to specify a featured image in the database, so that the content can be controlled better. Just hide it in the theme.

  17. sbbn
    Member
    Posted 1 year ago #

    Quick question: When commenting out

    the_post_thumnbnail()

    does that mean all the Featured Image features are disabled? Or only the image appearing at the top of the post in TwentyTwelve?

    I had the same issue the OP had, and I like Featured Image and ONLY want to prevent the image from appearing at the top of the post. Everything else Featured Image does is fine. Because I don't understand code that well, I don't specifically know what commenting that bit of code does, and wanted to ask. Thanks!

  18. Mark Shirley
    Member
    Posted 1 year ago #

    Im using featured image in twentytwelve and it just doesnt work nothing happens nothing appears

  19. esmi
    Forum Moderator
    Posted 1 year ago #

    As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem - despite any similarity in symptoms - is likely to be completely different.

  20. Mark Shirley
    Member
    Posted 1 year ago #

    Sorry esmi i have done elsewhere but got no answer just saw it here just cant understand how to change the branding image using the featured image in twentytwelve for different pages ill post a new topic. :-)

  21. sbbn
    Member
    Posted 1 year ago #

    Thanks esmi, and good luck Mark, I hope you find a solution!

    If anyone has any ideas or info for the Featured Image issue I have, I'd love to hear them!

  22. caminantestelar
    Member
    Posted 1 year ago #

    when i comment the post thumbnail in content.php, it also delted the thumbnail from the category archive...

  23. dgrylas
    Member
    Posted 1 year ago #

    I also am still looking for workable solution for featured image in twenty twelve.
    I want a new image to appear on main image banner every time a new navigation button is selected to go to a new page. I have this message posted in related topics but have not got a workable solution yet.

  24. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    @dgrylas - please stop posting in other people's or old threads - that's not how these forums work - stick with YOUR thread here:

    http://wordpress.org/support/topic/twenty-twelve-featured-image?replies=6

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic