Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function smr_product_the_frontend_item() {
- if ( has_post_thumbnail() )
- $image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'product-home' );
- $height = ( isset( $image ) && isset( $image[2] ) ) ? $image[2] . 'px' : 'auto';
- ?><div class="item-review_wrapper">
- <div class="item-review">
- <?php
- $imglink = get_post_meta( get_the_ID(), '_imglink', true );
- $visit = get_post_meta( get_the_ID(), '_producturl', true );
- if ( $imglink == '1' && $visit) {
- $url = $visit;
- } else {
- $url = get_permalink();
- }
- $rvcred = get_post_meta( get_the_ID(), '_rvcred', true );
- $rvfet = get_post_meta( get_the_ID(), '_rvfet', true );
- $rvcp = get_post_meta( get_the_ID(), '_rvcp', true );
- $rvsfty = get_post_meta( get_the_ID(), '_rvsfty', true );
- $rvcs = get_post_meta( get_the_ID(), '_rvcs', true );
- $overall = ($rvcred + $rvfet + $rvcp + $rvsfty + $rvcs)/5;
- ?>
- <a href="<?php echo $url; ?>" class="item-review-image" style="height: <?php echo $height; ?>;">
- <span class="item-review-options">
- <i></i>
- <div class="vertical-helper"></div>
- </span>
- <?php if ( has_post_thumbnail() ): ?>
- <?php the_post_thumbnail('product-home'); ?>
- <?php else: ?>
- <img src="<?php echo smr_get_default_image_url('smr-product-item'); ?>"/>
- <?php endif;?>
- </a>
- <div class="rating-image">
- <span class="empty"><span class="full" style="width:<?php echo $overall*21;?>px;"></span></span>
- </div>
- <div class="item-desc">
- <p>
- <?php echo nl2br(get_post_meta( get_the_ID(), '_productdesc', true ));?>
- </p>
- </div>
- <div class="mb">
- <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>
- </div>
- </div>
- <?php smr_product_best_flag(); ?>
- <div class="rvlink">
- <a class="rvlinka" href="<?php the_permalink(); ?>"><?php echo get_post_meta( get_the_ID(), '_productname', true );?> Review</a>
- </div>
- </div><?php
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement