WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using post thumbnails for custom header images -- works fine on straight pages. But custom templates that load a loop (including index) are pulling the first image instead of using the one set in the featured image field.

Anyone seen this before?



share|improve this question
what theme are you using? can you post the code of the custom template(s)? – Michael Feb 1 '13 at 23:46
It's a custom theme. I'm using <?php the_post_thumbnail('header'); ?> to get the image and then there's a loop that looks, pretty much like any other -- <?php $args = array('post_type' => 'people', 'category_name'=> 'current'); $people_posts = new WP_Query($args); if($people_posts->have_posts()) : while($people_posts->have_posts()) : $people_posts->the_post(); ?> etc etc.... – Martin Feb 2 '13 at 3:43

Your theme uses a custom function to get the first image, if you post your index.php codes here you maybe find someone to help.

share|improve this answer
Nope -- just the standard '<?php the_post_thumbnail(); ?>` – Martin Feb 2 '13 at 3:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.