title: Use The Loop to create a custom htmlstructure
body: <p>Im using a plugin to create slides, and typically you have a structure where a parentpage with vertical slides is defined by a class, and then a child inside that container is defined by another class to create horizontal slides inside the parentage. This is how the structure is needed for this work: </p>
  
  <p><code>&lt;div class="section"&gt;
      &lt;div class="slide"&gt; Slide 1 &lt;/div&gt;
      &lt;div class="slide"&gt; Slide 2 &lt;/div&gt;
      &lt;div class="slide"&gt; Slide 3 &lt;/div&gt;
      &lt;div class="slide"&gt; Slide 4 &lt;/div&gt;
  &lt;/div&gt;</code></p>
  
  <p>however, I'm implanting this to wordpress and have a loop that creates vertical slides from pages automatically, but this makes horizontal pages trickier. </p>
  
  <p>So i wonder if i can make a loop that  creates the needed htmlstructure, and maybe a subquery? to put a class on child pages and place them in the parent container? </p>
  
  <p>`if (($locations = get_nav_menu_locations()) &amp;&amp; $locations['main-nav'] ) {
          $menu = wp_get_nav_menu_object( $locations['main-nav'] );
          $menu_items = wp_get_nav_menu_items($menu->term_id);
          $pageID = array();
          foreach($menu_items as $item) {
              if($item->object == 'page')
                  $pageID[] = $item->object_id;</p>
  
  <pre><code>    }
  
  query_posts( array( 'post_type' =&gt; 'page','post__in' =&gt; $pageID, 'posts_per_page' =&gt; count($pageID), 'orderby' =&gt; 'post__in' ) );
  </code></pre>
  
  <p>}
          while(have_posts() ) : the_post();</p>
  
  <p>?> </p>
  
  <p>post_name;?>" class="section"> -->
  
          post_name;?>" class="section" data-anchor="post_name;?>">`</p>