Want more features on Pastebin? Sign Up, it's FREE!
Guest

template structure

By: alchymyth on Mar 18th, 2013  |  syntax: PHP  |  size: 0.75 KB  |  views: 166  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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(); ?>
clone this paste RAW Paste Data