Advertisement
Digitalraindrops

Custom Post Type - Page of Posts

Apr 27th, 2012
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.54 KB | None | 0 0
  1. <?php
  2. /**
  3.  Template Name: Custom Posts
  4. */
  5.  
  6. get_header(); ?>
  7.  
  8.         <div id="primary">
  9.             <div id="content" role="main">
  10.  
  11.                 <?php while ( have_posts() ) : the_post(); ?>
  12.  
  13.                     <?php get_template_part( 'content', 'page' ); ?>
  14.  
  15.                 <?php endwhile; // end of the loop. ?>
  16.  
  17.                
  18.             <?php /* Start This is the Information Posts Area */
  19.                 $temp_post = $post; // Store the Page the Post
  20.        
  21.                 $wp_query= null;
  22.                 $wp_query = new WP_Query();
  23.                 $args = array(
  24.                     'post_type' => 'information',
  25.                     'posts_per_page' => 2,
  26.                     'order' => 'desc',
  27.                     'paged' => $paged,
  28.                 );
  29.                 $wp_query->query( $args );
  30.             ?>
  31.  
  32.         <?php if ( $wp_query->have_posts() ) : ?>
  33.    
  34.             <!-- Add Top Pagination Code Here -->
  35.             <?php twentyeleven_content_nav( 'nav-above' ); ?>
  36.            
  37.             <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  38.                 <div id="post-<?php the_ID(); ?>" <?php // post_class(); ?>>
  39.                     <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>             
  40.                     <div class="entry-summary">
  41.                         <?php the_excerpt(); ?>
  42.                     </div><!-- .entry-content -->
  43.                 </div><!-- #post-## -->
  44.            
  45.             <?php endwhile; ?>
  46.        
  47.             <!-- Add Bottom Pagination Code Here -->
  48.             <?php twentyeleven_content_nav( 'nav-below' ); ?>
  49.            
  50.         <?php endif; ?>
  51.  
  52.         <?php $post = $temp_post; // Reset the Post ?>
  53.  
  54.             </div><!-- #content -->
  55.         </div><!-- #primary -->
  56.  
  57. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement