Stuck with conflicting loops on page template

Well for one thing I can spot that it seems your endwhile loop is closing OUTSIDE of a stray DIV tag. Try fixing that.