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 trialshareyourpeace
3,244 PointsIs it endwhile(); or endwhile; ? Video shows endwhile();
Does it matter !
I also notice that there is a missing div tag. Does this matter in wordpress ?
5 Answers
Andrew Shook
31,709 PointsIt's "endwhile" not "endwhile()".
geoffrey
28,736 PointsIn php, you can use while these ways:
<?php
/* exemple 1 */
$i = 1;
while ($i <= 10) {
echo $i++;
}
/* exemple 2 */
$i = 1;
while ($i <= 10):
echo $i;
$i++;
endwhile;
?>
I have no knowledge about endwhile(); It's not a function from what I know, unless there is something specific to wordpress I don't know ;)
Phil Purves
9,827 PointsYes, I saw that on the video too - an error i think - it should be without the ()
trishagawley
10,483 PointsGlad I looked at this thread. It might be a good idea to update the video.
Byron Twogood
14,631 PointsFrom the research I just performed, it looks like there's no need for the parenthesis before the semicolon. I don't think there are any variables to attach to the "endwhile;" statement. I could be wrong. I haven't gotten deep into WordPress yet.