Example #1
0
function vc_module_func($atts, $content = null)
{
    extract(shortcode_atts(array('image' => '', 'image_size' => '', 'scale' => '', 'title' => '', 'title_font_size' => '', 'url' => '', 'badge_text' => '', 'badge_color' => ''), $atts));
    if (empty($title_font_size)) {
        $title_font_size = '24px';
    }
    if (!$image_size) {
        $image_size = 'thumbnail';
    }
    $img = lpd_getImageBySize(array('attach_id' => $image, 'thumb_size' => $image_size, 'class' => "img-responsive"));
    $out = '';
    $no_scale = '';
    if ($title_font_size == "36px") {
        $title_font_size = " class='large'";
    } else {
        $title_font_size = "";
    }
    if ($title) {
        $title = '<h3' . $title_font_size . '>' . esc_html($title) . '</h3>';
    }
    if ($badge_text) {
        $badge_text = '<span class="lpd-badge" style="background-color:' . esc_attr($badge_color) . ';">' . esc_html($badge_text) . '</span>';
    }
    if ($title) {
        $module_content = '<span class="module_content"><table><tbody><tr><td style="vertical-align:middle">' . $title . '<div class="sep-border"></div></td></tr></tbody></table></span>';
    }
    if ($scale) {
        $no_scale = ' module-no-scale';
    }
    $out .= '<a href="' . esc_url($url) . '" class="lpd-module' . esc_attr($no_scale) . '">' . $badge_text . '' . $img['thumbnail'] . '' . $module_content . '</a>';
    return $out;
}
Example #2
0
 function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
 {
     global $post, $product;
     $shop_thumb_type = ot_get_option('shop_thumb_type');
     $shop_thumb_custom = ot_get_option('shop_thumb_custom');
     $catalog_type = ot_get_option('catalog_type');
     if (!$shop_thumb_custom) {
         $shop_thumb_custom = 'thumbnail';
     }
     $output = '';
     if (has_post_thumbnail()) {
         if ($shop_thumb_type == "none") {
             $thumbnail = get_the_post_thumbnail($post->ID, $size);
         } elseif ($shop_thumb_type == "custom-size") {
             $img = lpd_getImageBySize(array('attach_id' => get_post_thumbnail_id($post->ID), 'thumb_size' => $shop_thumb_custom, 'class' => ""));
             $thumbnail = $img['thumbnail'];
         } else {
             $thumbnail = get_the_post_thumbnail($post->ID, $shop_thumb_type);
         }
         $output .= '<a class="img-transaction" href="' . get_permalink() . '">';
         $output .= '<div class="featured-img">';
         $output .= $thumbnail;
         $output .= '</div>';
         $output .= '<div class="gallery-img">';
         $attachment_ids = $product->get_gallery_attachment_ids();
         if ($attachment_ids) {
             $loop = 0;
             foreach ($attachment_ids as $attachment_id) {
                 $loop++;
                 $image_link = wp_get_attachment_url($attachment_id);
                 if (!$image_link) {
                     continue;
                 }
                 if ($loop == 1) {
                     if ($shop_thumb_type == "none") {
                         $output .= wp_get_attachment_image($attachment_id, $size);
                     } elseif ($shop_thumb_type == "custom-size") {
                         $img = lpd_getImageBySize(array('attach_id' => $attachment_id, 'thumb_size' => $shop_thumb_custom, 'class' => ""));
                         $output .= $img['thumbnail'];
                     } else {
                         $output .= wp_get_attachment_image($attachment_id, $shop_thumb_type);
                     }
                 }
             }
         } else {
             $output .= $thumbnail;
         }
         $output .= '</div>';
         $output .= '</a>';
     } elseif (wc_placeholder_img_src()) {
         $thumbnail = '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="580" height="580" />';
         $output .= '<a href="' . get_permalink() . '">';
         $output .= '<div class="featured-img">';
         #$output .= wc_placeholder_img( $size );
         $output .= $thumbnail;
         $output .= '</div>';
         $output .= '</a>';
     }
     return $output;
 }
function vc_multi_slider_func($atts, $content = null)
{
    extract(shortcode_atts(array('taxonomy' => '', 'include_id' => '', 'orderby' => '', 'order' => '', 'exclude_ids' => '', 'navigation_type' => ''), $atts));
    if (empty($taxonomy)) {
        $taxonomy = 'product_cat';
    }
    if (empty($orderby)) {
        $orderby = 'date';
    }
    if (empty($order)) {
        $order = 'DESC';
    }
    if (empty($navigation_type)) {
        $navigation_type = 'text';
    }
    multi_slider();
    $args = array('include' => $include_id);
    $exclude_ids = array($exclude_ids);
    global $the_multi_slider_ID;
    $the_multi_slider_ID = rand();
    $image_size = "250x250";
    ob_start();
    ?>
   
   		<?php 
    if (is_plugin_active('woocommerce/woocommerce.php')) {
        ?>
   
        <?php 
        $terms = get_terms($taxonomy, $args);
        ?>
        
		<div id="mi-slider-<?php 
        echo esc_attr($the_multi_slider_ID);
        ?>
" class="mi-slider<?php 
        if ($navigation_type == "icon") {
            ?>
 mi-slider-icon-nav<?php 
        }
        ?>
">
		
			<?php 
        foreach ($terms as $term) {
            ?>
			<?php 
            $args = array('post_type' => 'product', $taxonomy => $term->slug);
            $products = new WP_Query($args);
            if ($products->have_posts()) {
                ?>
			
			<ul>
				<?php 
                $query = new WP_Query();
                ?>
				
				<?php 
                $new_args = array('orderby' => $orderby, 'order' => $order, 'post_type' => 'product', $taxonomy => $term->slug, 'posts_per_page' => '4', 'post__not_in' => $exclude_ids);
                ?>

				<?php 
                $query->query($new_args);
                ?>

				<?php 
                if ($query->have_posts()) {
                    while ($query->have_posts()) {
                        $query->the_post();
                        ?>

				<li><a href="<?php 
                        the_permalink();
                        ?>
">
				
			    <?php 
                        if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                            ?>
			    
			    	<?php 
                            $img = lpd_getImageBySize(array('attach_id' => get_post_thumbnail_id(get_the_ID()), 'thumb_size' => $image_size, 'class' => "img-responsive"));
                            ?>
                    <?php 
                            echo $img['thumbnail'];
                            ?>

                <?php 
                        } else {
                            ?>
                	<img src="<?php 
                            echo esc_url(get_template_directory_uri()) . '/assets/img/add-featured-image-square.png';
                            ?>
" alt="<?php 
                            the_title();
                            ?>
">
                <?php 
                        }
                        ?>
				
				<h4><?php 
                        the_title();
                        ?>
</h4></a></li>
				
				<?php 
                    }
                }
                ?>
			</ul>
			
			<?php 
            }
            wp_reset_query();
        }
        ?>
			
			<nav<?php 
        if ($navigation_type == "icon") {
            ?>
 class="icons-nav"<?php 
        }
        ?>
>
				<?php 
        foreach ($terms as $term) {
            ?>
				
					<?php 
            $product_cat_icon = '';
            ?>
				
					<?php 
            if ($navigation_type == "icon") {
                ?>
						<?php 
                $product_cat_id = $term->term_id;
                $product_cat_term_meta = get_option("product_cat_{$product_cat_id}");
                $product_cat_icon = wp_get_attachment_image_src($product_cat_term_meta['custom_term_meta6'], 'full');
                ?>
					<?php 
            }
            ?>
				
					<a href="#"<?php 
            if ($product_cat_icon) {
                ?>
 class="lpd-tooltip" data-toggle="tooltip" data-placement="bottom" title="<?php 
                echo esc_attr($term->name);
                ?>
"<?php 
            }
            ?>
>
					
						<?php 
            if ($navigation_type == "icon") {
                ?>
							<span class="icon">
							<?php 
                if ($product_cat_icon) {
                    ?>
								<img src="<?php 
                    echo esc_url($product_cat_icon[0]);
                    ?>
">
							<?php 
                } else {
                    ?>
								<?php 
                    echo esc_html($term->name);
                    ?>
							<?php 
                }
                ?>
							</span>
						<?php 
            } else {
                ?>
							<?php 
                echo esc_html($term->name);
                ?>
						<?php 
            }
            ?>
						
					</a>
					
				<?php 
        }
        ?>
			</nav>
		</div>
		
		<?php 
    }
    ?>
		
	<?php 
    $multi_js = new multi_class();
    $multi_js->multi_callback();
    ?>
				
	<?php 
    return ob_get_clean();
}
Example #4
0
?>
"<?php 
if ($product_image_a_type) {
    echo $animation_att;
}
?>
>
	
		<?php 
if (has_post_thumbnail()) {
    $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
    $image_link = wp_get_attachment_url(get_post_thumbnail_id());
    if ($product_image_type == "none") {
        $image = get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'), array('title' => $image_title));
    } elseif ($product_image_type == "custom-size") {
        $img = lpd_getImageBySize(array('attach_id' => get_post_thumbnail_id($post->ID), 'thumb_size' => $product_image_custom, 'class' => ""));
        $image = $img['thumbnail'];
    } else {
        $image = get_the_post_thumbnail($post->ID, $product_image_type, array('title' => $image_title));
    }
    $attachment_count = count($product->get_gallery_attachment_ids());
    if ($attachment_count > 0) {
        $gallery = '[product-gallery]';
    } else {
        $gallery = '';
    }
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_title, $image), $post->ID);
} else {
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<img src="%s" alt="Placeholder" />', wc_placeholder_img_src()), $post->ID);
}
?>