Advertisement
deliciousthemes

Haze - Portfolio Single

Jun 23rd, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.43 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php   if (have_posts()) : while (have_posts()) : the_post(); ?>
  4.         <section class="page-title">
  5.             <div class="double-separator"></div>
  6.             <div class="breadcrumbs">
  7.                 <div class="two-third align-left">
  8.                     <?php if (function_exists('dt_breadcrumbs')) dt_breadcrumbs(); ?>
  9.                 </div>
  10.                
  11.                 <div class="one-third column-last align-right">
  12.                     <div class="single-portfolio-nav" class="clearfix">
  13.                         <div class="previous-post-link"><?php previous_post_link('%link'); ?></div>
  14.                         <div class="next-post-link"><?php next_post_link('%link'); ?></div>
  15.                     </div> 
  16.                 </div>
  17.             </div><!--end breadcrumbs-->
  18.             <div class="double-separator"></div>
  19.         </section>
  20.     </div><!--end top-->
  21.    
  22.     <div class="centered-wrapper">
  23.         <?php
  24.         //get meta
  25.         $portfolio_date = get_post_meta($post->ID, 'haze_portfolio_date', TRUE);
  26.         $portfolio_location = get_post_meta($post->ID, 'haze_portfolio_location', TRUE);
  27.         $portfolio_camera = get_post_meta($post->ID, 'haze_portfolio_camera', TRUE);
  28.         $portfolio_website = get_post_meta($post->ID, 'haze_portfolio_website', TRUE);
  29.         $portfolio_url = get_post_meta($post->ID, 'haze_portfolio_url', TRUE);
  30.         $portfolio_desc = get_post_meta($post->ID, 'haze_portfolio_desc', TRUE);
  31.         ?> 
  32.         <section class="portfolio-single"> 
  33.             <div class="percent-three-fourth">
  34.                 <div id="container-slides">
  35.                     <div id="slides">
  36.                         <div class="slides_container">                 
  37.                             <?php    
  38.                             //get attachment count
  39.                             $get_attachments = get_children( array( 'post_parent' => $post->ID ) );
  40.                             $attachments_count = count( $get_attachments );
  41.                            
  42.                             //attachment loop
  43.                             $args = array(
  44.                                 'post_type' => 'attachment',
  45.                                 'orderby' => 'menu_order',                             
  46.                                 'post_status' => null,
  47.                                 'post_parent' => get_the_ID(),
  48.                                 'post_mime_type' => 'image',                               
  49.                                 'posts_per_page' => -1
  50.                             );
  51.                             $attachments = get_posts($args);
  52.                            
  53.                             //start loop
  54.                             foreach ($attachments as $attachment) :
  55.                            
  56.                                 //get images                       
  57.                                 $full_img = wp_get_attachment_image_src( $attachment->ID, 'full-size');
  58.                                 $portfolio_single = wp_get_attachment_image_src( $attachment->ID, 'portfolio-single');
  59.                                
  60.                                 ?>
  61.                                 <div class="slide">
  62.                                     <a href="<?php echo $full_img[0]; ?>" title="<?php echo apply_filters('the_title', $attachment->post_title); ?>" <?php if($attachments_count =='1') { echo 'rel="prettyPhoto"'; } else { echo 'rel="prettyPhoto[pp_gal]"'; } ?>>
  63.                                         <img src="<?php echo $portfolio_single[0]; ?>" width="<?php echo $portfolio_single[1]; ?>" height="<?php echo $portfolio_single[2]; ?>" alt="<?php echo apply_filters('the_title', $attachment->post_title); ?>" />
  64.                                     </a>
  65.                                 </div>
  66.  
  67.                         <?php endforeach;?>    
  68.                         </div><!--end slides_container-->
  69.                        
  70.                         <a href="#" class="prev"><img src="<?php echo get_template_directory_uri(); ?>/images/light-arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
  71.                         <a href="#" class="next"><img src="<?php echo get_template_directory_uri(); ?>/images/light-arrow-next.png" width="24" height="43" alt="Arrow Next"></a>
  72.                     </div><!--end slides-->
  73.                 </div><!--end container-slides-->
  74.             </div><!--end three-fourth-->
  75.                
  76.             <div class="percent-one-fourth column-last">
  77.                 <h2><?php the_title(); ?></h2>
  78.                 <?php if(!empty($portfolio_desc)) { echo $portfolio_desc; } ?>
  79.                 <ul class="item-details">
  80.                     <?php if(!empty($portfolio_date)) {?><li><span><?php _e('Date','haze'); ?>: </span><?php echo $portfolio_date; ?></li><?php } ?>           
  81.                     <?php if(!empty($portfolio_location)) {?><li><span><?php _e('Location','haze'); ?>: </span><?php echo $portfolio_location; ?></li><?php } ?>           
  82.                     <?php if(!empty($portfolio_camera)) {?><li><span><?php _e('Camera','haze'); ?>: </span><?php echo $portfolio_camera; ?></li><?php } ?>         
  83.                     <?php if(!empty($portfolio_website)) {?><li><span><?php _e('Website','haze'); ?>: </span><a href="<?php echo $portfolio_url; ?>"><?php echo $portfolio_website; ?></a></li><?php } ?>          
  84.                 </ul><!--end item-details-->
  85.             </div><!--end one-third--> 
  86.            
  87.         </section><!--end portfolio-single-->
  88.         <div class="space"></div>
  89.         <div class="clear"></div>
  90.         <?php the_content(); ?>
  91.        
  92.         <div class="separator"></div>
  93.        
  94.         <?php  get_template_part( 'includes/related-portfolio-posts');  ?> 
  95.        
  96.     <?php endwhile; endif; ?>  
  97.        
  98.     </div><!--end centered-wrapper-->
  99.  
  100. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement