Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $c = 0;
- while (have_posts()) : the_post();
- $c++;
- if($c == 4) {
- $style = 'ml0';
- $c = 0;
- } else { $style=''; }
- $post_type = get_post_type( $post->ID );
- if ($post_type == 'engagement_ring') {
- $metaVar = 'engagement_ring';
- } elseif ($post_type == 'wedding_ring') {
- $metaVar = 'wedding_ring';
- } elseif ($post_type == 'pendants') {
- $metaVar = 'pendant';
- } elseif ($post_type == 'earrings') {
- $metaVar = 'earring';
- } elseif ($post_type == 'bracelets') {
- $metaVar = 'bracelet';
- }
- /* GET VARIBLES */
- $inventory = get_post_meta($post->ID, '_cmb_'.$metaVar.'_inventory', true);
- $preDiscount = get_post_meta($post->ID, '_cmb_'.$metaVar.'_regular_price', true);
- $discount = get_post_meta($post->ID, '_cmb_'.$metaVar.'_discounted_price', true);
- $description = get_post_meta($post->ID, '_cmb_'.$metaVar.'_description', true);
- ?>
- <div class="relatedProducts">
- <div class="releatedProduct <?php echo $style; ?>">
- <!--===END=== THUMBNAIL ========-->
- <?php
- $image_id = get_post_thumbnail_id();
- $image_url = wp_get_attachment_image_src($image_id,'large');
- $image_url = $image_url[0];
- ?>
- <a title="<?php the_title(); ?>" href="<?php echo $image_url; ?>" class="lightbox">
- <span class="rollRelated" ></span>
- <?php echo get_the_post_thumbnail($post->ID, 'releated'); ?>
- </a>
- <!--===END=== THUMBNAIL ========-->
- <div class="productTitle"><a href="<?php the_permalink(); ?>"><?php echo mb_substr(get_the_title(), 0, 28); ?></a></div>
- <div class="productDescription"><?php echo mb_substr($description, 0, 80); ?>...</div>
- <div class="readmore"><a href="<?php the_permalink(); ?>" rel="nofollow"><?php _e('Read More', 'sagive'); ?></a></div>
- </div>
- </div>
- <?php endwhile;?>
- <div class="navigation"><?php wp_pagenavi(); ?></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement