Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Portfolio Landing Page

Philippe GEFFE
Philippe GEFFE
2,746 Points

The "row" trick end up opening an empty row ?

I found the row trick clever. In this example I suppose that after the 8th portfolio piece, this loop will open a new (empty) row (?) Is there a way to detect when the last post is processed in the loop and just put a closing </div> and not a </div><div class="row"> ?

2 Answers

Hi Philippe,

You're correct. If your portfolio pieces are a multiple of 4 then you'll end up getting an empty row div at the end.

I answered a similar previous question here: https://teamtreehouse.com/community/the-row-trick-in-wordpress-course-imperfect which should help you out.

Philippe GEFFE
Philippe GEFFE
2,746 Points

Thanks Jason ! Your solution works perfectly. I didn't seen the similar question. Sorry for that !