Advertisement
alchymyth

template structure

Mar 18th, 2013
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2. /* Template Name: All Pages on One
  3. */
  4. get_header();
  5.  
  6. $this_page = $post->ID;
  7.  
  8. $all_pages = new WP_Query( array( 'post_type' => 'page', 'posts_per_page' => -1, 'post__not_in' => array( $this_page ) ) );
  9.  
  10. if( $all_pages->have_posts() ) :
  11. while( $all_pages->have_posts() ) :
  12. $all_pages->the_post(); ?>
  13.  
  14. <div class="page-wrapper">
  15.     <div class="page-header-section">
  16.     //your HEADER section//
  17.     </div><!--/ .page-header -->
  18.    
  19.     <div class="page-menu">
  20.     //your MENU section//
  21.     </div><!--/ .page-menu -->
  22.    
  23.     <div class="page-content">
  24.     //your PAGE content, for example: //<?php the_title(); ?>
  25.     </div><!--/ .page-content -->
  26. </div><!--/ .page-wrapper -->
  27.  
  28. <?php endwhile;
  29. else : echo 'no pages';
  30. endif; wp_reset_postdata();
  31.  
  32. get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement