Advertisement
OptimatorX

WP Catalogue - single-wpcproduct.php

Jun 7th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.60 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.  
  4.  
  5. <!--Content-->
  6.  
  7. <div id="content" role="main"> 
  8.  
  9.         <?php wp_catalogue_breadcumb(); ?>
  10.  
  11.         <div id="wpc-catalogue-wrapper">
  12.  
  13.         <?php
  14.  
  15.  
  16.  
  17.        
  18.  
  19.         global $post;
  20.  
  21.         $terms1 = get_the_terms($post->id, 'wpccategories');
  22.  
  23.        
  24.  
  25.         if($terms1 !=null || $term1 !=null){
  26.  
  27.             foreach( $terms1 as $term1 ){
  28.  
  29.                 $slug       = $term1->slug;
  30.  
  31.                 $term_id    = $term1->term_id;
  32.  
  33.             };
  34.  
  35.         }
  36.  
  37.         global $wpdb;  
  38.  
  39.        
  40.  
  41.      $args = array(
  42.  
  43.             'orderby' => 'term_order',
  44.  
  45.             'order' => 'ASC',
  46.  
  47.             'hide_empty' => true,
  48.  
  49.         );
  50.  
  51.         $terms  =   get_terms('wpccategories',$args);
  52.  
  53.         $count  =   count($terms);
  54.  
  55. echo '<div id="wpc-col-1">
  56.  
  57.        <ul class="wpc-categories">';
  58.  
  59.         if($count>0){
  60.  
  61.             echo '<li class="wpc-category"><a href="'. get_option('catalogue_page_url') .'">All Products</a></li>';
  62.  
  63.             foreach($terms as $term){
  64.  
  65.                 if($term->slug==$slug){
  66.  
  67.                 $class  =   'active-wpc-cat';
  68.  
  69.             }else{
  70.  
  71.                 $class  =   '';
  72.  
  73.             }
  74.  
  75.             echo '<li  class="wpc-category ' . $class . '"><a href="'.get_term_link($term->slug, 'wpccategories').'">'. $term->name .'</a></li>';  
  76.  
  77.             }
  78.  
  79.         }else{
  80.  
  81.             echo '<li  class="wpc-category"><a href="#">No category</a></li>'; 
  82.  
  83.         }
  84.  
  85.         echo '</ul>
  86.  
  87.        </div>';
  88.  
  89.     ?>
  90.  
  91.         <!--/Left-menu-->
  92.  
  93.         <!--col-2-->
  94.  
  95.  
  96.  
  97.         <div id="wpc-col-2">
  98.  
  99.         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  100.  
  101.         <?php
  102.  
  103.             $img1       =   get_post_meta($post->ID,'product_img1',true);
  104.  
  105.             $img2       =   get_post_meta($post->ID,'product_img2',true);
  106.  
  107.             $img3       =   get_post_meta($post->ID,'product_img3',true);
  108.            
  109.             $img4       =   get_post_meta($post->ID,'product_img4',true);
  110.            
  111.             $img5       =   get_post_meta($post->ID,'product_img5',true);
  112.  
  113.         ?>   
  114.  
  115.         <div id="wpc-product-gallery">
  116.  
  117.         <?php
  118.  
  119.             if(get_option('image_height')){
  120.  
  121.                 $img_height =   get_option('image_height');
  122.  
  123.             }else{
  124.  
  125.                 $img_height =   348;
  126.  
  127.             }
  128.  
  129.             if(get_option('image_width')){
  130.  
  131.                 $img_width  =   get_option('image_width');
  132.  
  133.             }else{
  134.  
  135.                 $img_width  =   490;
  136.  
  137.             }
  138.  
  139.             $icroping   =   get_option('croping');
  140.  
  141.         ?>
  142.  
  143.         <div class="product-img-view" style="width:<?php echo $img_width; ?>px; height:<?php echo $img_height; ?>px;">
  144.  
  145.         <img src="<?php echo $img1; ?>" alt="" id="img1" height="<?php echo $img_height; ?>" width="<?php echo $img_width; ?>" />
  146.  
  147.         <img src="<?php echo $img2; ?>" alt="" id="img2" height="<?php echo $img_height; ?>" width="<?php echo $img_width; ?>" style="display:none;" />
  148.  
  149.         <img src="<?php echo $img3; ?>" alt="" id="img3" height="<?php echo $img_height; ?>" width="<?php echo $img_width; ?>" style="display:none;"  />
  150.        
  151.         <img src="<?php echo $img4; ?>" alt="" id="img4" height="<?php echo $img_height; ?>" width="<?php echo $img_width; ?>" style="display:none;"  />
  152.        
  153.         <img src="<?php echo $img5; ?>" alt="" id="img5" height="<?php echo $img_height; ?>" width="<?php echo $img_width; ?>" style="display:none;"  />
  154.  
  155.         </div>
  156.  
  157.         <div class="wpc-product-img">
  158.  
  159.         <?php if($img1): ?>
  160.  
  161.         <div class="new-prdct-img"><img src="<?php echo $img1; ?>" alt="" width="151" id="img1" /></div>
  162.  
  163.         <?php endif; if($img2): ?>
  164.  
  165.         <div class="new-prdct-img"><img src="<?php echo $img2; ?>" alt="" width="151" id="img2"/></div>
  166.  
  167.         <?php endif; if($img3):?>
  168.  
  169.         <div class="new-prdct-img"><img src="<?php echo $img3; ?>" alt="" width="151" id="img3"/></div>
  170.        
  171.         <?php endif; if($img4):?>
  172.  
  173.         <div class="new-prdct-img"><img src="<?php echo $img4; ?>" alt="" width="151" id="img4"/></div>
  174.        
  175.         <?php endif; if($img5):?>
  176.  
  177.         <div class="new-prdct-img"><img src="<?php echo $img5; ?>" alt="" width="151" id="img5"/></div>
  178.  
  179.         <?php endif; ?>
  180.  
  181.         </div>
  182.  
  183.         <div class="clear"></div>
  184.  
  185.         </div>
  186.  
  187.         <?php $product_price = get_post_meta($post->ID, 'product_price', true); ?>
  188.  
  189.         <h4>Product Details  <?php if($product_price): ?><span class="product-price">Price: <span><?php echo $product_price; ?></span></span><?php endif; ?></h4>
  190.  
  191. <article class="post">
  192.  
  193.         <div class="entry-content">
  194.  
  195.             <?php the_content(); ?>
  196.  
  197.         <?php
  198.  
  199.             if(get_option('next_prev')==1){
  200.  
  201.         echo '<p class="wpc-next-prev">';
  202.  
  203.         previous_post_link('%link', 'Previous');
  204.  
  205.         next_post_link('%link', 'Next');
  206.  
  207.         echo '</p>';
  208.  
  209.        
  210.  
  211.    
  212.  
  213.         }
  214.  
  215.         ?>
  216.  
  217.         </div>
  218.  
  219.  
  220.  
  221. </article>
  222.  
  223.         <?php endwhile; endif; ?>
  224.  
  225.         </div>
  226.  
  227.         <!--/col-2-->
  228.  
  229.     <div class="clear"></div>    
  230.  
  231.     </div>
  232.  
  233. </div>
  234.  
  235.   <!--/Content-->
  236.  
  237. <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement