Custom Post Type: Featured Image Problem
-
I need someone’s help with this one. I have created a custom post-type and have allowed ‘thumbnails’ to be used. I then created a new page and assigned the page-template to a php script within my theme.
In my ‘register_post_type’ call arguments I am setting this:
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' )Also in my functions.php I have included the following:
add_theme_support( 'post-thumbnails' );I am then using the following in my custom page-template file:
$loop = new WP_Query( array( 'post_type' => 'work_type', 'posts_per_page' => 9 ) ); while ( $loop->have_posts() ) : $loop->the_post(); get_the_post_thumbnail( the_ID(), 'thumbnail' ); endwhile;The html that get’s returned is the page’s ID. Any ideas how I can get the image returned and not the ID?
Thank you for your assistance!
The topic ‘Custom Post Type: Featured Image Problem’ is closed to new replies.