Advertisement
deliciousthemes

Portfolio Category Page

Oct 20th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.30 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.     <div class="centered-wrapper">
  4.        
  5.         <div class="page-title-subtitle">
  6.             <h2><?php _e('Category: ', 'delicious'); ?><strong><?php single_cat_title(); ?></strong></h2>
  7.             <?php
  8.                 $categ_desc = category_description( get_the_category( $id ) );
  9.  
  10.                 if($categ_desc != '') {
  11.                 ?>
  12.                     <h3><?php echo $categ_desc ?> </h3>
  13.                 <?php } ?>
  14.         </div>
  15.  
  16.         <section class="patti-grid" id="gridwrapper_portfolio">
  17.             <section id="portfolio-wrapper">       
  18.                 <ul class="portfolio grid isotope grid_portfolio">
  19.                
  20.                     <?php
  21.                     // Begin The Loop
  22.                     if (have_posts()) : while (have_posts()) : the_post();  
  23.  
  24.                     $portf_thumbnail = get_post_meta($post->ID,'dt_portf_thumbnail',true); 
  25.                     $item_class = 'item-small';
  26.  
  27.                     $thumb_id = get_post_thumbnail_id($post->ID);
  28.                     $image_url = wp_get_attachment_url($thumb_id); 
  29.  
  30.                     switch ($portf_thumbnail) {
  31.                         case 'portfolio-big':
  32.                             $grid_thumbnail = aq_resize($image_url, 566, 440, true);
  33.                             $item_class = 'item-wide';
  34.                             break;
  35.                         case 'portfolio-small':
  36.                             $grid_thumbnail = aq_resize($image_url, 281, 219, true);
  37.                             $item_class = 'item-small';
  38.                             break;
  39.                         case 'half-horizontal':
  40.                             $grid_thumbnail = aq_resize($image_url, 566, 219, true);
  41.                             $item_class = 'item-long';
  42.                             break;
  43.                         case 'half-vertical':
  44.                             $grid_thumbnail = aq_resize($image_url, 281, 440, true);
  45.                             $item_class = 'item-high';
  46.                             break;                         
  47.                     }      
  48.  
  49.                     $terms = get_the_terms( get_the_ID(), 'portfolio_cats' );
  50.  
  51.                     ?>
  52.                     <li class="grid-item <?php echo $item_class; ?>">
  53.                         <a href="<?php the_permalink(); ?>">
  54.                             <div class="grid-item-on-hover">
  55.                                 <div class="grid-text">
  56.                                     <h1><?php echo get_the_title(); ?></h1>
  57.                                 </div>
  58.                                 <span>
  59.                                 <?php
  60.                                     $copy = $terms;
  61.                                     foreach ( $terms as $term ) {
  62.                                        echo $term->name;
  63.                                         if (next($copy )) {
  64.                                             echo ', ';
  65.                                         }
  66.                                     }
  67.                                 ?>
  68.                                 </span>
  69.                             </div>
  70.                             <img src="<?php echo $grid_thumbnail; ?>" alt="" />
  71.                         </a>
  72.                     </li>
  73.  
  74.        
  75.                     <?php endwhile; endif; // END the Wordpress Loop ?>
  76.                 </ul>
  77.                 <?php dt_navigation(); ?>      
  78.                        
  79.             </section>
  80.         </section>
  81.     </div><!--end centered-wrapper-->
  82. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement