Advertisement
Guest User

Ola

a guest
Mar 30th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function getSubPagesSortedByMenu($forPageID){
  5.     return get_pages(array(
  6.         sort_order => asc,
  7.         sort_column => menu_order,
  8.         child_of => $forPageID
  9.     ));
  10. }
  11.  
  12. function getCurrentPageID() {
  13.     if(have_posts()) {
  14.         while(have_posts()) {
  15.             the_post();
  16.             $current_page_id = get_the_ID();
  17.         }
  18.     }
  19.     return $current_page_id;
  20. }
  21.  
  22. echo '<div id="portfolio-columns">';
  23.     foreach (getSubPagesSortedByMenu(getCurrentPageID()) as $child){
  24.         echo '<div class="portfolio_page_post '. $child->post_name .'">';
  25.         echo "<h2>".$child->post_title."</h2>";
  26.         echo '<div class="entry">'.$child->post_content."</div>";
  27.         echo "</div>";
  28.     }
  29. echo '</div>';
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement