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 trialYohan Park
7,148 PointsIs 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
Mark Truitt
8,758 Pointsthe_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
7,148 PointsYohan Park
7,148 PointsThat makes sense. Thank you, Mark.