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

endwhile() error

This is frustrating. The endwhile should not be called as a function, but he does in the video and doesn't correct it. Adding

<?php endwhile(); endif; ?>

instead of

<?php endwhile; endif; ?>

results in a 500 error on your site.

Just leaving this here in case anyone else has difficulty.

I agree, this is very sloppy video editing. And I don't believe the nonsense about baking in errors for the student's benefit either - this problem was flagged months ago and still hasn't been fixed.

Peter Gregory
Peter Gregory
6,614 Points

Thank you! Saved me time!

9 Answers

William Harpley
William Harpley
20,792 Points

Wow! Big help... horrible video editing. Thanks David

This thread helped me a lot. The error is still in the video. Also not sure @calumhartley how it works in the video.

Calum Hartley
Calum Hartley
6,959 Points

Does anyone know why it seemed to work in this video? When you are referring to the video editing do you just mean that they have edited out him going back and correcting this?

During this course there have been a couple of other syntax errors similar to this that have left me confused as to where to use semi-colons, brackets, etc.

Thanks David, saved me time!

Thanks for this thread! Should really be corrected in the video.

I should note here that I just discovered that Team Treehouse stopped developing these WP courses about 6 months ago. I'm guessing any mistakes in the videos won't be corrected.

George Boyd
George Boyd
1,402 Points

Thanks! This saved me much frustration and time, geeze....

Thanks, my code still doesn't work but now I have one more thing I can cross off my list ^_^

Thanks for this, really. I have spent a whole day on this, googling, searching, editing my htaccess, messing with the terminal, re-doing each step exactly according to the videos, uninstall and reinstall mamp and wordpress, used a different computer - EVERYTHING. all because of something so small and easily fixed. ugh.