WordPress.org

Support

Support » Themes and Templates » Twenty Twelve » [Resolved] Twenty Twelve Featured Image Showing up twice

[Resolved] Twenty Twelve Featured Image Showing up twice

Viewing 15 replies - 1 through 15 (of 23 total)
  • esmi

    @esmi

    Forum Moderator

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

    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).

    Steps for reproduction:

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

    esmi

    @esmi

    Forum Moderator

    I still can’t replicate the issue.

    Michael

    @alchymyth

    Forum Moderator

    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(); ?>

    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.

    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.

    @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?

    @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?

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

    Michael

    @alchymyth

    Forum Moderator

    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(); ?>

    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.

    esmi

    @esmi

    Forum Moderator

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

    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.

    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.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘[Resolved] Twenty Twelve Featured Image Showing up twice’ is closed to new replies.
Skip to toolbar