Advertisement
askwpcoach

Trying to paginate custom post type

Feb 7th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.09 KB | None | 0 0
  1.   <?php
  2.             query_posts( array(
  3.                             'post_type' => 'portfolio',
  4.                             'posts_per_page' => 21,
  5.                             'orderby'=> 'menu_order',
  6.                             'paged'=>$paged
  7.                 )
  8.             );
  9.             ?>
  10.    <!--BEGIN #masonry-->
  11.   <div id="masonry-portfolio">
  12.     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  13.     <!--BEGIN .hentry -->
  14.     <div <?php post_class('quickFlip'); ?> id="post-<?php the_ID(); ?>">
  15.       <div class="blackPanel">
  16.         <div class="flipbg">
  17.           <?php
  18.  
  19.                             $lightbox = get_post_meta(get_the_ID(), 'tz_portfolio_lightbox', TRUE);
  20.                             $thumb = get_post_meta(get_the_ID(), 'tz_portfolio_thumb', TRUE);
  21.                             $embed = get_post_meta(get_the_ID(), 'tz_portfolio_embed_code', TRUE);
  22.                             $image  = get_post_meta(get_the_ID(), 'tz_portfolio_image', TRUE);
  23.                             $image2 = get_post_meta(get_the_ID(), 'tz_portfolio_image2', TRUE);
  24.                             $image3 = get_post_meta(get_the_ID(), 'tz_portfolio_image3', TRUE);
  25.                             $image4 = get_post_meta(get_the_ID(), 'tz_portfolio_image4', TRUE);
  26.                             $image5 = get_post_meta(get_the_ID(), 'tz_portfolio_image5', TRUE);
  27.                             $large_image =  wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' );
  28.  
  29.                             if($lightbox == 'no')
  30.                                 $lightbox = FALSE;
  31.                             if($thumb == '')
  32.                                 $thumb = FALSE;
  33.                              $large_image = $large_image[0];
  34.  
  35.                             ?>
  36.           <div class="post-thumb clearfix">
  37.             <?php //if($lightbox && $embed == '') : ?>
  38.            
  39.             <!--<a class="lightbox" title="<?php //the_title(); ?>" href="<?php //echo $large_image; ?>"> -->
  40.            
  41.             <a href="<?php echo get_post_meta($post->ID,'portfolio_post_url',true); ?>?iframe=true&width=100%&height=100%" class="iframe" rel="prettyPhoto"> <span class="overlay post-<?php echo $post->ID;?>" title="<?php the_title(); ?>"> <span class="icon"></span> </span>
  42.             <?php if($thumb) : ?>
  43.             <img src="<?php echo get_bloginfo('template_url').'/includes/timthumb.php?src='. $thumb .'&h=170&w=230&zc=1'; ?>" alt="<?php the_title(); ?>" />
  44.             <?php else: ?>
  45.             <?php the_post_thumbnail('portfolio-thumb'); ?>
  46.             <?php endif; ?>
  47.             </a>
  48.             <?php //else: ?>
  49.            
  50.             <!--<a title="<?php //the_title(); ?>" href="<?php //the_permalink(); ?>"> -->
  51.             <!-- <a title="<?php //the_title(); ?>" href="<?php //echo get_post_meta($post->ID,'portfolio_post_url',true); ?>" target="_blank">
  52.                                     <?php //if($thumb) : ?>
  53.                                         <img src="<?php //echo get_bloginfo('template_url').'/includes/timthumb.php?src='. $thumb .'&h=170&w=230&zc=1'; ?>" alt="<?php //the_title(); ?>" />
  54.                                     <?php //else: ?>
  55.                                     <?php //the_post_thumbnail('portfolio-thumb'); ?>
  56.                                     <?php //endif; ?>
  57.                                     </a>   -->
  58.             <?php //endif; ?>
  59.           </div>
  60.           <div class="arrow"></div>
  61.           <div class="entry-excerpt">
  62.             <h2 class="title">
  63.               <?php the_title(); ?>
  64.             </h2>
  65.             <?php the_excerpt(); ?>
  66.           </div>
  67.           <?php if(!is_singular()) : get_template_part('includes/post-meta'); endif; ?>
  68.         </div>
  69.       </div>
  70.       <div class="redPanel">
  71.         <div class="flipbg">
  72.           <?php if(!is_singular()) : get_template_part('includes/post-notetag'); endif; ?>
  73.         </div>
  74.       </div>
  75.       <!--END .hentry-->
  76.     </div>
  77. <?php endwhile; ?>
  78. <div style="clear:both"></div>
  79.         <div class="navigation">
  80.             <div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
  81.             <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
  82.         </div>
  83.  
  84. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement