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 WordPress Theme Development Adding a Blog to a WordPress Theme Coding the Blog Homepage

Yohan Park
Yohan Park
7,148 Points

Is there a specific reason for if(the_post_thumbnail()): and not isset()?

Is there a specific reason to use if(the_post_thumbnail()): and not isset()? What's the difference?

1 Answer

the_post_thumbnail is specific to WP and returns true or false on if the post has a thumbnail. ISSET is specific to PHP and seeing if a variable is set. A variable can be set but not contain a value.

Yohan Park
Yohan Park
7,148 Points

That makes sense. Thank you, Mark.