Twenty Twelve – Code Specific Featured Image For Each Category

This post provides a solution which is specifically coded to work on the Twenty Twelve default theme for WordPress.

The code has been tested on this theme and will need slight modification to work on other default themes.

It creates a template tag which you can use to replace the default template tag in the content.php file.

Code Installation

  1. The Gist labelled functions.php contains the code you simply copy from the view raw link and paste at the end of your child themes functions.php file.
  2. The Gist labelled content.php contains the template tag which has been added to the code on line 21 of the content.php file, a copy of which has been copied over to the Twenty Twelve child theme.

The solution assumes you have uploaded images for each category to your child themes images folder.

The code displays the same image for all posts in each specific category meaning you will need to upload an image for each category to your child themes images folder otherwise you can add a default.


Comments

One response to “Twenty Twelve – Code Specific Featured Image For Each Category”

  1. Brad,

    I am interested in the magazine layout for eleven40 pro.

    THanks.

    David

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.