Welcome to the Treehouse Community
Looking to learn something new?
Kent Åsvang18,822 Points
I is actually necessary to include the if-statement in the wordpress-loop?
Shouldn't it be sufficient to use the condition in the while loop? To me it seems redundant to first check have_posts(), and then let the while loop run as long as it is true. I'd be grateful if anyone could provide some clarity as to why we do it this way.
In some cases there may need to be processing before or after the posts are processed. This processing may not need to be done if there are no posts. For example, you may want to alert about new posts. This does not need to happen if there are no posts.