Advertisement
elbego

single-fw_product.php

Jun 28th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.54 KB | None | 0 0
  1. <?php get_template_part( 'header-blog' );           // different header / gives body class 'blog' ?>
  2. <div id="header-holder">
  3.     <?php get_template_part( 'nav' );           // Navigation bar (nav.php) ?>
  4. </div>
  5.  
  6.  
  7. <div id="center">
  8. <div id="maincontainer" class="<?php echo get_the_title($ID) ?>">
  9.  
  10.     <div id="positioncontainer">
  11.     <div id="content">
  12.    
  13.        <div id="leftcontent" class="home">  
  14.            
  15.        realted product list to go here
  16.        
  17.        </div>  
  18.  
  19.              
  20.      <?php if (have_posts()) : ?>            
  21.      <?php while (have_posts()) : the_post();
  22.       $custom = get_post_custom(get_the_ID()); // to gather custom meta     ?>  
  23.            
  24.       <div class="post" id="post-<?php the_ID(); ?>">    
  25.                        
  26.                         <style type="text/css">
  27.                             div.product h3{
  28.                                 background-color: <?php echo get_option('color'); ?>;
  29.                             }
  30.                         </style>  
  31.                                                                    
  32.                        
  33.                         <div id="copycontent" class="product">
  34.                          
  35.                              <div id="title">
  36.                                 <h1>
  37.                                     <?php
  38.                                     $terms = wp_get_post_terms($post->ID,'productranges');  
  39.                                     foreach ($terms as $term) {  
  40.                                         echo $term->name;  
  41.                                     }
  42.                                      ?>        
  43.                                 </h1>
  44.                            
  45.                                 <h2>
  46.                                     <?php
  47.                                     $terms = wp_get_post_terms($post->ID,'productranges');  
  48.                                     foreach ($terms as $term) {  
  49.                                         echo $term->description;  
  50.                                     }
  51.                                      ?>        
  52.                                 </h2>
  53.                             </div>
  54.                        
  55.                             <h3><?php the_title(); ?></h3>
  56.                             <div id="product-holder">
  57.                                 <?php   //Add featured image/thumbnails to page
  58.                                  if ( has_post_thumbnail()) {
  59.                                      
  60.                                    $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium');
  61.                                    echo '<div class="image-holder"> <div class="image-entry"> ';
  62.                                    echo get_the_post_thumbnail($post->ID, 'medium');
  63.                                    echo ' </div></div>';
  64.                                  }
  65.                                  ?>                          
  66.                                
  67.                                
  68.                                 <?php the_content('Read the rest of this entry &raquo;'); ?>
  69.                                
  70.                                 <div id="product-details">
  71.                                     <h4 class="price">Ingredients:</h4>
  72.                                     <p><?php echo $custom["ingredients"][0];?></p>
  73.                                     <h4 class="price">Analysis:</h4>
  74.                                     <p><?php echo $custom["analysis"][0];?></p>
  75.                                 </div>
  76.                             </div>
  77.                         </div>
  78.                                
  79.                     </div>
  80.                    
  81.            
  82.        
  83.                     <div id="rightcontent" class="blog">
  84.                        
  85.                        
  86.                         <div id="allproducts">
  87.                         <?php
  88.                                  if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Product Right Sidebar')) : // right content
  89.                             ?>
  90.                             <?php
  91.                                  endif;
  92.                             ?>      
  93.                         </div>
  94.                        
  95.                        
  96.                         <div id="productprice">
  97.                             <h3> BUY ONLINE NOW </h3>
  98.                             <div class="price"><?php echo $custom["price"][0];?></div>
  99.                         </div>                                 
  100.                          
  101.                                                                        
  102.                         <?php
  103.                        
  104.                         $query_tax = array('taxonomy' => 'testimonials','field' => 'id','terms' => $query_cat);            
  105.                         $args = array('tax_query'=>array($query_tax),'posts_per_page' => 1,'orderby' => 'rand','post_type' => 'testimonial', 'paged'=>$paged);
  106.                         $posts = query_posts ($args);?>
  107.                         <?php
  108.                         foreach ($posts as $post) : setup_postdata($post); ?>
  109.                         <h3><?php the_title(); ?></h3>
  110.                         <?php the_excerpt('<div class="readmore">'); ?><a href="/testimonials">read more...</a>
  111.                        
  112.                         <?php endforeach; ?>
  113.                         <?php
  114.                        
  115.                         //Reset Query
  116.                         wp_reset_query();?>
  117.                        
  118.                     </div>
  119.                  
  120.      <?php endwhile; ?>
  121.      <?php endif; ?>    
  122.                                  
  123.    
  124.                          
  125.    
  126.    
  127.  </div>
  128.    
  129.  </div>
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement