Advertisement
deliciousthemes

Haze - Portfolio Page as Masonry

Oct 15th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.90 KB | None | 0 0
  1. <?php
  2. /*
  3.  
  4. Template Name: Portfolio Gallery
  5.  
  6.  */
  7. ?>
  8. <?php get_header(); ?>
  9.  
  10.         <section class="page-title">
  11.             <div class="double-separator"></div>
  12.             <div class="breadcrumbs">
  13.                 <div class="one-half align-left">
  14.                     <?php if (function_exists('dt_breadcrumbs')) dt_breadcrumbs(); ?>
  15.                 </div>
  16.                
  17.                 <div class="one-half column-last align-right">
  18.                 <?php              
  19.                 //get meta
  20.                     $tagline = get_post_meta($post->ID, 'haze_tagline', TRUE); 
  21.                     if(!empty($tagline)) {  echo $tagline; }
  22.                 ?>                     
  23.                 </div>
  24.             </div><!--end breadcrumbs-->
  25.             <div class="double-separator"></div>
  26.         </section>
  27.     </div><!--end top-->
  28.  
  29.     <div class="centered-wrapper">
  30.  
  31.         <section id="portfolio-gallery">
  32.  
  33.             <?php              
  34.             if(!empty($data['no_filter_portfolio'])) {
  35.                 $portfolio_posts_per_page =  $data['no_filter_portfolio'];
  36.             }
  37.             else {
  38.                 $portfolio_posts_per_page = 12;
  39.                 }              
  40.            
  41.                 //get post type - portfolio
  42.                 query_posts(array(
  43.                     'post_type'=>'portfolio',
  44.                     'posts_per_page' => -1,
  45.                     'paged' => $paged
  46.                 ));
  47.             ?>  
  48.             <div class="portfolio-gallery-items <?php if($data['portfolio_cols']) echo strtolower($data['portfolio_cols']); ?>-columns">
  49.  
  50.                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  51.  
  52.                 <div class="portfolio-item">
  53.                     <div class="rollover"></div>               
  54.                     <?php   // Check if wordpress supports featured images, and if so output the thumbnail
  55.                     if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) :
  56.                    
  57.                         // Output the featured image ?>
  58.                         <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('portfolio-gallery-thumb'); ?></a>
  59.                        
  60.                     <?php endif; ?>
  61.                 </div>
  62.            
  63.                 <?php endwhile; endif; // END the Wordpress Loop ?>
  64.             </div> 
  65.                
  66.                 <?php wp_reset_query(); // Reset the Query Loop ?>         
  67.                    
  68.         </section>
  69.  
  70.     </div><!--end centered-wrapper-->
  71.  
  72. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement