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 Custom Post Type Templates in WordPress The Portfolio Single Page

shareyourpeace
shareyourpeace
3,244 Points

Is 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
Andrew Shook
31,709 Points

It's "endwhile" not "endwhile()".

geoffrey
geoffrey
28,736 Points

In 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
Phil Purves
9,827 Points

Yes, I saw that on the video too - an error i think - it should be without the ()

Glad I looked at this thread. It might be a good idea to update the video.

From 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.