• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

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.

Reader Interactions

Comments

  1. David says

    August 19, 2014 at 9:43 pm

    Brad,

    I am interested in the magazine layout for eleven40 pro.

    THanks.

    David

    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags