Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress Custom Post Types and Fields in WordPress Custom Post Type Templates

Stanley Foss
Stanley Foss
5,755 Points

Custom Post Type not displaying image. (How to Make a Website with Wordpress)

Custom Post Type not displaying image. I've tried deactivating and re-activating the two plugins from this lesson - but it's still not showing the images. All I see is the example Title, Description, and Price. No art is shown.

2 Answers

Kairi Jaano
Kairi Jaano
778 Points

Hi.

Maybe you are missing this piece of code from functions.php

add_theme_support('post-thumbnails');

or you have to add "thumbnail" to post type like that: 'supports' => array( 'title', 'editor', 'thumbnail' ),

or add this to theme file: <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>

Stanley Foss
Stanley Foss
5,755 Points

Hi, thanks for the reply. I'm very new to Wordpress. Would I add this code by going to Appearance / Editor / then clicking on Page Template(page.php)? 'm not sure how to find functions.php

Thanks for your time!

Hi Stanley,

I had this problem too. it turns out that when I set up the Image type in the Custom Field Types that I had selected the default of Return Value = Image Object when it should have been = Image URL.

Once I did this the images displayed as expected.