Advertisement
Guest User

Product Frontend

a guest
May 6th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.25 KB | None | 0 0
  1. function smr_product_the_frontend_item() {
  2.     if ( has_post_thumbnail() )
  3.         $image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'product-home' );
  4.         $height = ( isset( $image ) && isset( $image[2] ) ) ? $image[2] . 'px' : 'auto';
  5.     ?><div class="item-review_wrapper">
  6.         <div class="item-review">
  7.                 <?php
  8.                     $imglink = get_post_meta( get_the_ID(), '_imglink', true );
  9.                     $visit = get_post_meta( get_the_ID(), '_producturl', true );
  10.                         if ( $imglink == '1' && $visit) {
  11.                             $url = $visit;
  12.                         } else {
  13.                             $url = get_permalink();
  14.                         }
  15.                     $rvcred = get_post_meta( get_the_ID(), '_rvcred', true );
  16.                     $rvfet = get_post_meta( get_the_ID(), '_rvfet', true );
  17.                     $rvcp = get_post_meta( get_the_ID(), '_rvcp', true );
  18.                     $rvsfty = get_post_meta( get_the_ID(), '_rvsfty', true );
  19.                     $rvcs = get_post_meta( get_the_ID(), '_rvcs', true );
  20.                     $overall = ($rvcred + $rvfet + $rvcp + $rvsfty + $rvcs)/5;
  21.                 ?>            
  22.             <a href="<?php echo $url; ?>" class="item-review-image" style="height: <?php echo $height; ?>;">
  23.                 <span class="item-review-options">
  24.                     <i></i>
  25.                     <div class="vertical-helper"></div>
  26.                 </span>
  27.                 <?php if ( has_post_thumbnail() ): ?>
  28.                     <?php the_post_thumbnail('product-home'); ?>
  29.                 <?php else: ?>
  30.                     <img src="<?php echo smr_get_default_image_url('smr-product-item'); ?>"/>
  31.                 <?php endif;?>
  32.             </a>
  33.             <div class="rating-image">
  34.                 <span class="empty"><span class="full" style="width:<?php echo $overall*21;?>px;"></span></span>
  35.             </div>
  36.             <div class="item-desc">
  37.                 <p>
  38.                     <?php echo nl2br(get_post_meta( get_the_ID(), '_productdesc', true ));?>
  39.                 </p>
  40.             </div>
  41.             <div class="mb">
  42.                 <p><img src="<?php echo get_stylesheet_directory_uri() . '/images/mb.png';?>" alt=""><span>Money-Back:</span> <?php echo get_post_meta( get_the_ID(), '_productmb', true );?></p>
  43.             </div>
  44.         </div>
  45.         <?php smr_product_best_flag(); ?>
  46.         <div class="rvlink">
  47.             <a class="rvlinka" href="<?php the_permalink(); ?>"><?php echo get_post_meta( get_the_ID(), '_productname', true );?> Review</a>
  48.         </div>
  49.     </div><?php
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement