Uncategorized, Website Design

Double Images Showing on Twenty Twelve Theme

wordpress twenty twelve double images

Moving a WordPress blog from one domain to a new one is never a quick and easy task.  And that task is even more difficult when you change the theme.

I was tasked with moving a portion of a companies blog to another domain.  Long story short they had different businesses and wanted to separate the blogs to the individual websites to boost their SEO juice and put all relevant content with each business and not the main company domain.  (Wow my HS english teacher would be annoyed at that run-on sentence.)

Part of the job was to make the blog look similar to the main website.  The website is a dynamic template site required from the franchisor.  The Twenty Twelve theme seemed simple and easy enough to modify so I chose it.  I modified the colors, background and menu to all match the main website.  Then the primary plugins were added and settings tweaked.  The content export and import went smoothly and everything seemed OK.

I started looking at the code of the site and noticed that the Open Graph code was not picking up the thumbnail for the page.  Then . . . Oh yeah the images don’t move with the import/export feature to therefore there is no thumbnail or featured image.  For the old posts this doesn’t really matter but for new posts this is kind of a big deal.  Especially if there happens to be a page that people want to share.  Nothing worse than having someone share your link on Facebook or try to pin an image to Pinterest and the company logo (default Open Graph image coded into the blog) becomes the image.  That will kill all viral traffic quick.

In my office we use Windows Live Writer for posting to the company blogs.  Unfortunately this doesn’t allow the blogger to assign a feature image so someone who is familiar with WordPress needs to go into the admin area and add the featured image.  Kind of a pain but it works for the company bloggers.

So all that leads me to this.

To fully test the new blog I wrote the post in Live Writer, published it with a 2 hour delay, and went into the admin area and set the featured image.  I previewed the page and Voilà two images.  Crap!  I had had this happen on my photography site.  I did a quick search on Google for “how to double image in twenty twelve theme” and after reading 3-4 Q&A posts – nothing.  I went back to Google and search for “how to remove featured image from twenty twelve theme”.  I found a post that recommended looking at the content.php file.  I did and I saw the area above the entry-title where the image was showing up.  Ok easy fix.

How to fix the issue of two images showing up on a post in the WordPress Twenty Twelve theme – one above the post title and then the one that you actually put in the post:

  1. Open the “content.php” file in the Appearance => Editor
  2. On line #18 you’ll see the following code – “<?php the_post_thumbnail(); ?>”
  3. Comment out this one line so it looks like this – “<?php // the_post_thumbnail(); ?>”
  4. Click Update File

This shouldn’t have taken me so long to figure out.

Perhaps my next post will be how to change the background color/image of the primary menu (that one took a bit of playing around).