使用wordpress中的循环为父页面/子页面创建一个特定的html结构

Had no idea how to describe my problem, but hope it made any sense. Im trying to invoke fullpage.js (https://github.com/alvarotrigo/fullPage.js/blob/master/README.md)to a wordpress theme, and it works fairly good so far. The script uses divs for slides, and nested divs for horizontal slides inside a parent slide. Like this:

<div class="section"> <div class="slide"> Slide 1 </div> <div class="slide"> Slide 2 </div> <div class="slide"> Slide 3 </div> <div class="slide"> Slide 4 </div> </div>

However, I'm using code from this place: http://www.themevan.com/build-an-one-page-portfolio-website-with-wordpress/?codekitCB=413560456.282228 To create anchor links for each page, and i run this loop to make a slide from every page made:

<div id="pageSlide-<?php echo $post->post_name;?>" class="section" data-anchor="<?php echo $post->post_name;?>">

This works great, but makes it hard to do horizontal slides. Is there anyway to create a loop that creates the needed htmlstructure for pages and child pages?