Advertisement
Digitalraindrops

Single Custom Post

Mar 13th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The widget template for displaying information posts
  4.  */
  5. global $widget_args;
  6. $postid = $widget_args['postid'];
  7. $thumbnail = $widget_args['thumbnail'];
  8. $excerpt = $widget_args['excerpt'];
  9. $uid = $widget_args['uid'];
  10.  
  11. $post_args = array(
  12.     'p' => $postid,
  13.     'post_type' => 'information',
  14.     'post_status' => 'publish',
  15. );
  16.  
  17. $post_query = new WP_Query( $post_args );
  18.  
  19. if ( $post_query->have_posts() ) : ?>
  20.    
  21.     <?php while ( $post_query->have_posts() ) : $post_query->the_post(); ?>
  22.        
  23.         <article id="post-<?php the_ID(); ?><?php echo $uid; ?>" <?php post_class(); ?>>
  24.             <?php /* Do we have a thumbnail to display? */ ?>
  25.             <?php if( !$thumbnail && has_post_thumbnail() ) : ?>
  26.                 <div class="info-thumb aligncenter">
  27.                     <?php the_post_thumbnail( 'info-thumb' ); ?>
  28.                 </div>                 
  29.             <?php endif; ?>
  30.            
  31.             <?php if( $excerpt ) : ?>
  32.                 <?php the_excerpt(); ?>            
  33.             <?php else: ?>
  34.                 <?php the_content(); ?>            
  35.             <?php endif; ?>
  36.        
  37.         </article>
  38.     <div class="cleared"></div>
  39.    
  40.     <?php endwhile; ?>
  41.    
  42. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement