OK, I got a custom post type with thumbnail enabled which adds the "featured images" panel to that post-type just fine, but in my template when I do
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
echo 'none';
}
it just shows 'none' on each one even though I have a featured image set... I have add_theme_support('post-thumbnails',array('post','custom_post_type'));
so it's supported by the theme but has_post_thumbnail
always returns false what's going on here???
My template is : archive-custom_post_type.php :
<?php
$loop = new WP_Query(array( 'post_type' => 'clients', 'posts_per_page' => -1 ));
if($loop){
?>
<ul>
<?php
while ( $loop->have_posts() ) : $loop->the_post();
?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php
if ( has_post_thumbnail($post->ID) ) {
the_post_thumbnail('thumbnail');
echo get_post($post->ID)->post_excerpt;
} else {
echo 'broken ::' . $post->ID;
echo get_post($post->ID)->post_excerpt;
}
?>
</a>
</li>
<?php
endwhile;
//wp_reset_postdata();
?>
</ul>
<?php
}
?>