Advertisement
Guest User

Untitled

a guest
Jan 28th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php $counter = 1 ?>
  2. <div class="row-fluid">
  3. <?php
  4. $pages = get_pages('child_of='.$post->ID.'&sort_order=asc&sort_column=menu_order&parent='.$post->ID);
  5. foreach($pages as $page) { ?>
  6.     <h2><?php echo $page->post_title ?></h2>
  7.     <?php
  8.     $the_query = new WP_Query( array(
  9.             'post_parent' => $page->ID,
  10.             'orderby' => 'menu_order',
  11.             'order' => 'ASC',
  12.             'posts_per_page' => 3,
  13.     ));
  14.     while ( $the_query->have_posts() ) :
  15.     $the_query->the_post();
  16.     ?>
  17.         <div class="span4">
  18.             <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2>
  19.             <?php the_content(); ?>
  20.         </div>
  21.     <? if ($counter % 3 == 0): ?>
  22.     </div>
  23.     <div class="row-fluid">
  24.             <?php endif; ?>
  25.     <?php $counter++; ?>
  26.     <?php
  27.         endwhile;
  28.         wp_reset_postdata();
  29. } ?>
  30. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement