WordPress WordPress Theme Development Adding a Blog to a WordPress Theme Coding the Blog Homepage

Yohan Park
Yohan Park
7,147 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,147 Points

That makes sense. Thank you, Mark.