Example #1
0
			<?php 
}
?>
			
			<?php 
if (has_post_thumbnail()) {
    ?>
				<?php 
    $img_id = get_post_thumbnail_id($post->ID);
    $alt_text = get_post_meta($img_id, '_wp_attachment_image_alt', true);
    ?>
				<a href="<?php 
    the_permalink();
    ?>
" id="<?php 
    echo etheme_get_image(false, 800, 1000, false);
    ?>
" class="product-content-image <?php 
    if ($hover == 'tooltip') {
        ?>
imageTooltip<?php 
    }
    ?>
 <?php 
    if ($hoverUrl != '') {
        ?>
with-hover<?php 
    }
    ?>
" data-images-list="<?php 
    echo get_images_list($width, $height, $crop);
            if (count($attachments) > 4 && $product_layout == 'universal') {
                ?>
jcarousel-horizontal<?php 
            }
            ?>
">
          <?php 
            foreach ($attachments as $id => $attachment) {
                if ($id == $main_img_id) {
                    continue;
                }
                $thumb_width = 68;
                $thumb_height = 68;
                $thumb_img = etheme_get_image($id, $thumb_width, $thumb_height, false);
                $big_img = etheme_get_image($id, $big_width, $big_height, false);
                $full_img = etheme_get_image($id, false, false, false);
                $img_title = get_post_meta($id, '_wp_attachment_image_alt', true);
                if (!$img_title) {
                    $img_title = get_post_field('post_title', $id);
                }
                ?>
              <li class="slide">
                <a href="<?php 
                echo $full_img;
                ?>
"
                   <?php 
                if (etheme_get_option('cloud_zoom')) {
                    ?>
class="cloud-zoom-gallery"<?php 
                } else {
        if (get_post_meta($id, '_woocommerce_exclude_image', true) == 1) {
            continue;
        }
        ?>
                    <li class="slide">
                        <a href="<?php 
        echo wp_get_attachment_url($id);
        ?>
" class="image" <?php 
        if ($zoom == 'disable') {
            ?>
 rel="lightbox[gal]"<?php 
        }
        ?>
 data-easyzoom-source="<?php 
        echo etheme_get_image($id, $mainWidth, $mainHeight, $crop);
        ?>
">
                            <?php 
        echo wp_get_attachment_image($id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'));
        ?>
                        </a>   
                    </li>               
                        
                    <?php 
    }
    ?>
        </ul>
    </div>
    <?php 
    if (count($attachment_ids) > 2 && $product_layout != 'variant3') {
Example #4
0
 function get_images_list($width, $height, $crop)
 {
     global $post, $product, $woocommerce;
     $images_string = '';
     $attachment_ids = $product->get_gallery_attachment_ids();
     $_i = 0;
     $images_string .= etheme_get_image(false, $width, $height, $crop);
     if (count($attachment_ids) > 0) {
         $images_string .= ',';
         foreach ($attachment_ids as $value) {
             $_i++;
             $images_string .= etheme_get_image($value, $width, $height, $crop);
             if ($_i != count($attachment_ids)) {
                 $images_string .= ',';
             }
         }
     }
     return $images_string;
 }
Example #5
0
function etheme_featured_post_shortcode($atts)
{
    $a = shortcode_atts(array('title' => '', 'id' => '', 'class' => '', 'more_posts' => 1), $atts);
    $limit = 1;
    $width = 300;
    $height = 300;
    $lightbox = etheme_get_option('blog_lightbox');
    $blog_slider = etheme_get_option('blog_slider');
    $posts_url = get_permalink(get_option('page_for_posts'));
    $args = array('p' => $a['id'], 'post_type' => 'post', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => $limit);
    $the_query = new WP_Query($args);
    ob_start();
    ?>

    <?php 
    if ($the_query->have_posts()) {
        ?>

        <?php 
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $postId = get_the_ID();
            ?>

            <div class="featured-posts <?php 
            echo $a['class'];
            ?>
">
                <?php 
            if ($a['title'] != '') {
                ?>
                    <h3 class="title a-left"><span><?php 
                echo $a['title'];
                ?>
</span></h3>
                    <?php 
                if ($a['more_posts']) {
                    ?>
                            <?php 
                    echo '<a href="' . $posts_url . '" class="show-all-posts hidden-tablet hidden-phone">' . __('View more posts', ETHEME_DOMAIN) . '</a>';
                    ?>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>
                <div class="featured-post row">
                    <div class="col-md-6">
                        <?php 
            $width = etheme_get_option('blog_page_image_width');
            $height = etheme_get_option('blog_page_image_height');
            $crop = etheme_get_option('blog_page_image_cropping');
            ?>

                        <?php 
            $images = etheme_get_images($width, $height, $crop);
            ?>

                        <?php 
            if (count($images) > 0 && has_post_thumbnail()) {
                ?>
                            <div class="post-images nav-type-small<?php 
                if (count($images) > 1) {
                    ?>
 images-slider<?php 
                }
                ?>
">
                                <ul class="slides">
                                     <li><a href="<?php 
                the_permalink();
                ?>
"><img src="<?php 
                echo $images[0];
                ?>
"></a></li>
                                </ul>
                                <div class="blog-mask">
                                    <div class="mask-content">
                                        <?php 
                if ($lightbox) {
                    ?>
<a href="<?php 
                    echo etheme_get_image(get_post_thumbnail_id($postId));
                    ?>
" rel="lightbox"><i class="fa fa-resize-full"></i></a><?php 
                }
                ?>
                                        <a href="<?php 
                the_permalink();
                ?>
"><i class="fa fa-link"></i></a>
                                    </div>
                                </div>
                            </div>
                        <?php 
            }
            ?>
                    </div>
                    <div class="col-md-6">
                        <h4 class="post-title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h4>
                        <div class="post-info">
                            <span class="posted-on">
                                <?php 
            _e('Posted on', ETHEME_DOMAIN);
            ?>
                                <?php 
            the_time(get_option('date_format'));
            ?>
 
                                <?php 
            _e('at', ETHEME_DOMAIN);
            ?>
 
                                <?php 
            the_time(get_option('time_format'));
            ?>
                            </span> 
                            <span class="posted-by"> <?php 
            _e('by', ETHEME_DOMAIN);
            ?>
 <?php 
            the_author_posts_link();
            ?>
</span>
                        </div>
                        <div class="post-description">
                            <?php 
            the_excerpt();
            ?>
                            <a href="<?php 
            the_permalink();
            ?>
" class="button read-more"><?php 
            _e('Read More', ETHEME_DOMAIN);
            ?>
</a>
                        </div>
                    </div>
                </div>
            </div>

        <?php 
        }
        ?>

        <?php 
        wp_reset_postdata();
        ?>

    <?php 
    } else {
        ?>

        <p><?php 
        _e('Sorry, no posts matched your criteria.', ETHEME_DOMAIN);
        ?>
</p>

    <?php 
    }
    ?>

    <?php 
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
Example #6
0
    the_permalink();
    ?>
"><img src="<?php 
    echo $imgSrc;
    ?>
" alt="<?php 
    the_title();
    ?>
"></a>
					<div class="zoom">
						<div class="btn_group">
							<?php 
    if ($lightbox) {
        ?>
<a href="<?php 
        echo etheme_get_image(get_post_thumbnail_id($postId));
        ?>
" class="btn btn-black xmedium-btn" rel="lightbox"><span><?php 
        _e('View large', ETHEME_DOMAIN);
        ?>
</span></a><?php 
    }
    ?>
							<a href="<?php 
    the_permalink();
    ?>
" class="btn btn-black xmedium-btn"><span><?php 
    _e('More details', ETHEME_DOMAIN);
    ?>
</span></a>
						</div>
$catsClass = '';
foreach ($categories as $category) {
    $catsClass .= ' sort-' . $category->slug;
}
$columns = etheme_get_option('portfolio_columns');
?>
<div class="portfolio-item <?php 
echo $catsClass;
?>
">        
	<div class="portfolio-image">
		<?php 
if (has_post_thumbnail($postId)) {
    ?>
			<?php 
    $image = etheme_get_image(false, 220, 220);
    ?>
			<a href="<?php 
    the_permalink();
    ?>
"><img src="<?php 
    echo $image;
    ?>
" /></a>	
		<?php 
}
?>
        <div class="portfolio-mask"></div>
        <div class="portfolio-descr">
	        
	        <h3><?php 
$catsClass = '';
foreach ($categories as $category) {
    $catsClass .= ' sort-' . $category->slug;
}
$columns = etheme_get_option('portfolio_columns');
if ($_GET['col']) {
    $columns = $_GET['col'];
}
?>
<div class="portfolio-item article <?php 
echo $catsClass;
?>
">        
	<div class="portfolio-image">
		<img src="<?php 
echo etheme_get_image(false, 600, 600);
?>
" title="<?php 
the_title();
?>
"/>
        <div class="portfolio-mask"></div>
        <div class="portfolio-descr">
	        <?php 
if ($columns != 1) {
    ?>
			    <h3><?php 
    the_title();
    ?>
</h3>
		    <?php 
Example #9
0
                }
                ?>
										<a href="<?php 
                echo etheme_get_image($value);
                ?>
" <?php 
                if ($zoom == 'disable') {
                    ?>
rel="<?php 
                    echo $lightbox_rel;
                    ?>
"<?php 
                }
                ?>
 class="main-image zoom"><img src="<?php 
                echo etheme_get_image($value, $mainImageWidth, $mainImageHeight, $mainImageCrop);
                ?>
" title="<?php 
                $image_title;
                ?>
"></a></li>
								<?php 
            }
            ?>
						
							<?php 
        }
        ?>
						<?php 
    }
    ?>
  <?php 
do_action('woocommerce_before_shop_loop_item');
?>

  <?php 
woocommerce_get_template('loop/sale-flash.php');
?>

  <?php 
$placeholder_width = wc_get_image_size('shop_catalog_image_width');
$placeholder_height = wc_get_image_size('shop_catalog_image_height');
$url = wp_get_attachment_image_src(get_post_thumbnail_id($product->ID), array(260, 260));
if (has_post_thumbnail()) {
    ?>
      <a id="<?php 
    echo etheme_get_image($product->ID, 400, 400, false);
    ?>
" href="<?php 
    echo the_permalink();
    ?>
"
         class="product-image <?php 
    if ($product_img_hover == 'tooltip') {
        ?>
imageTooltip<?php 
    }
    ?>
">
        <?php 
    if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') {
        ?>
 /**
  * Display or return HTML-formatted testimonials.
  * @param  string/array $args  Arguments.
  * @since  1.0.0
  * @return string
  */
 function woothemes_testimonials($args = '')
 {
     global $post;
     $defaults = array('limit' => 5, 'orderby' => 'menu_order', 'interval' => 10000, 'order' => 'DESC', 'id' => 0, 'display_author' => true, 'display_avatar' => true, 'display_url' => true, 'pagination' => false, 'echo' => true, 'size' => 30, 'title' => '', 'before' => '', 'after' => '', 'before_title' => '', 'after_title' => '', 'type' => 'slider', 'columns' => 3, 'navigation' => false, 'category' => 0);
     $img_size = 40;
     $args = wp_parse_args($args, $defaults);
     // Allow child themes/plugins to filter here.
     $args = apply_filters('woothemes_testimonials_args', $args);
     $html = '';
     do_action('woothemes_testimonials_before', $args);
     // The Query.
     $query = woothemes_get_testimonials($args);
     $class = 'cbp-qtrotator';
     if ($args['type'] == 'slider') {
         $class = 'owl-carousel testimonials-slider';
     } elseif ($args['type'] == 'grid') {
         $img_size = 60;
         $class = 'testimonial-grid';
     }
     // The Display.
     if (!is_wp_error($query) && is_array($query) && count($query) > 0) {
         $html .= $args['before'] . "\n";
         if ('' != $args['title']) {
             $html .= $args['before_title'] . esc_html($args['title']) . $args['after_title'] . "\n";
         }
         $html .= '<div id="owl-testimonials" class="' . $class . ' testimonials" data-navigation="' . $args['navigation'] . '" data-interval="' . $args['interval'] . '" >' . "\n";
         // Begin templating logic.
         if ($args['type'] == 'slider') {
             $tpl = '<div id="quote-%%ID%%" class="item %%CLASS%%"><blockquote class="testimonials-text">%%TEXT%%</blockquote><div class="testimonial-info"> %%AVATAR%% <div class="testimonial-author">%%AUTHOR%%</div></div> <div class="clear"></div></div>';
         } elseif ($args['type'] == 'grid') {
             $tpl = '<div id="quote-%%ID%%" class="item col-lg-4 %%CLASS%%"><blockquote class="testimonials-text">%%TEXT%%</blockquote><div class="testimonial-info">%%AVATAR%% <div class="testimonial-author">%%AUTHOR%%</div></div> <div class="clear"></div></div>';
         }
         $tpl = apply_filters('woothemes_testimonials_item_template', $tpl, $args);
         $count = 0;
         if ($args['type'] == 'grid') {
             $html .= '<div class="row">';
         }
         foreach ($query as $post) {
             $count++;
             $template = $tpl;
             $css_class = 'quote';
             if (1 == $count) {
                 $css_class .= ' first';
             }
             if (count($query) == $count) {
                 $css_class .= ' last';
             }
             setup_postdata($post);
             $author = '';
             $author_text = '';
             // If we need to display the author, get the data.
             if (get_the_title($post) != '' && true == $args['display_author']) {
                 $author .= '<cite class="author">';
                 $author_name = get_the_title($post);
                 $author .= '<strong>' . $author_name . '</strong>';
                 if (isset($post->byline) && '' != $post->byline) {
                     $author .= ' <span class="excerpt">' . $post->byline . '</span><!--/.excerpt-->' . "\n";
                 }
                 if (true == $args['display_url'] && '' != $post->url) {
                     $author .= ' <span class="url"><a href="' . esc_url($post->url) . '">' . $post->url . '</a></span><!--/.excerpt-->' . "\n";
                 }
                 $author .= '</cite><!--/.author-->' . "\n";
                 // Templating engine replacement.
                 $template = str_replace('%%AUTHOR%%', $author, $template);
             } else {
                 $template = str_replace('%%AUTHOR%%', '', $template);
             }
             // Templating logic replacement.
             $template = str_replace('%%ID%%', get_the_ID(), $template);
             $template = str_replace('%%CLASS%%', esc_attr($css_class), $template);
             if (isset($post->image) && '' != $post->image && true == $args['display_avatar']) {
                 $image = '<img src="' . etheme_get_image(false, $img_size, $img_size, true) . '">';
                 $template = str_replace('%%AVATAR%%', '<a class="avatar-link">' . $image . '</a>', $template);
             } else {
                 $template = str_replace('%%AVATAR%%', '', $template);
             }
             // Remove any remaining %%AVATAR%% template tags.
             $template = str_replace('%%AVATAR%%', '', $template);
             $content = apply_filters('woothemes_testimonials_content', get_the_content(), $post);
             $template = str_replace('%%TEXT%%', $content, $template);
             // Assign for output.
             $html .= $template;
             if ($count % $args['columns'] == 0 && count($query) != $count && $args['type'] == 'grid') {
                 $html .= '<div class="clear"></div></div><div class="row">';
             }
         }
         if ($args['type'] == 'grid') {
             $html .= '<div class="clear"></div></div><!--row-->';
         }
         wp_reset_postdata();
         if ($args['pagination'] == true && count($query) > 1 && $args['effect'] != 'none') {
             $html .= '<div class="pagination">' . "\n";
             $html .= '<a href="#" class="btn-prev">' . apply_filters('woothemes_testimonials_prev_btn', '&larr; ' . __('Previous', ETHEME_DOMAIN)) . '</a>' . "\n";
             $html .= '<a href="#" class="btn-next">' . apply_filters('woothemes_testimonials_next_btn', __('Next', ETHEME_DOMAIN) . ' &rarr;') . '</a>' . "\n";
             $html .= '</div><!--/.pagination-->' . "\n";
         }
         $html .= '</div><!--/.testimonials-->' . "\n";
         $html .= $args['after'] . "\n";
     }
     // Allow child themes/plugins to filter here.
     $html = apply_filters('woothemes_testimonials_html', $html, $query, $args);
     if ($args['echo'] != true) {
         return $html;
     }
     // Should only run is "echo" is set to true.
     echo $html;
     do_action('woothemes_testimonials_after', $args);
     // Only if "echo" is set to true.
 }
Example #12
0
File: woo.php Project: scoutrul/sys
function etheme_woocommerce_subcategory_thumbnail($category)
{
    global $woocommerce;
    $small_thumbnail_size = apply_filters('single_product_small_thumbnail_size', 'shop_catalog');
    $dimensions = wc_get_image_size($small_thumbnail_size);
    $thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
    if ($thumbnail_id) {
        $image = etheme_get_image($thumbnail_id, 215, 215, false);
    } else {
        $image = wc_placeholder_img_src();
    }
    if ($image) {
        echo '<img src="' . $image . '" alt="' . $category->name . '" width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" />';
    }
}
Example #13
0
    function widget($args, $instance)
    {
        $cache = wp_cache_get('etheme_widget_recent_entries', 'widget');
        if (!is_array($cache)) {
            $cache = array();
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? false : $instance['title']);
        if (!($number = (int) $instance['number'])) {
            $number = 10;
        } else {
            if ($number < 1) {
                $number = 1;
            } else {
                if ($number > 15) {
                    $number = 15;
                }
            }
        }
        $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1));
        if ($r->have_posts()) {
            ?>
        <?php 
            echo $before_widget;
            ?>
        <?php 
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
            <div>
                <?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
                    <div class="recent-post-mini">
                        <?php 
                $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), array(130, 130));
                $url = $thumb[0];
                if ($url && $url != '') {
                    ?>
                            <a class="postimg" href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                    ?>
"><img src="<?php 
                    echo etheme_get_image(false, 70, 70);
                    ?>
" /></a>
                            
                        <?php 
                }
                ?>
                        <?php 
                if (get_the_title()) {
                    $title = get_the_title();
                } else {
                    $title = get_the_ID();
                }
                $title = trunc($title, 10);
                ?>
                        <a href="<?php 
                the_permalink();
                ?>
" <?php 
                if (!$url || $url == '') {
                    echo 'style="width:100%;"';
                }
                ?>
 title="<?php 
                echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                ?>
">
                            <?php 
                echo $title;
                ?>
 
                        </a><br />
                        <?php 
                _e('by', ETHEME_DOMAIN);
                ?>
 <strong><?php 
                the_author();
                ?>
</strong><br>
                        <?php 
                the_time(get_option('date_format'));
                ?>
                        <div class="clear"></div>
                    </div>
                <?php 
            }
            ?>
            </div>
        <?php 
            echo $after_widget;
            wp_reset_query();
            // Restore global post data stomped by the_post().
        }
        $cache[$args['widget_id']] = ob_get_flush();
        wp_cache_add('etheme_widget_recent_entries', $cache, 'widget');
    }
if ($woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0) {
    echo ' last';
}
?>
">

	<?php 
do_action('woocommerce_before_subcategory', $category);
?>

	<div class="mask-container">

		<?php 
$thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
if ($thumbnail_id) {
    $image = etheme_get_image($thumbnail_id);
} else {
    $image = woocommerce_placeholder_img_src();
}
if ($image) {
    echo '<img src="' . $image . '" alt="' . $category->name . '" />';
}
?>

		<div class="block-mask">
			<div class="mask-content">
				<a href="<?php 
echo get_term_link($category->slug, 'product_cat');
?>
"><i class="icon-link"></i></a>
			</div>
        if (wpsc_show_thumbnails()) {
            ?>
          <div class="imagecol" id="imagecol_<?php 
            echo wpsc_the_product_id();
            ?>
">

            <?php 
            etheme_product_labels();
            ?>

            <?php 
            if (wpsc_the_product_thumbnail()) {
                ?>
              <a id="<?php 
                echo etheme_get_image($id, 400, 400, false);
                ?>
"
                 href="<?php 
                echo wpsc_the_product_permalink();
                ?>
"
                 class="product-image <?php 
                if ($product_img_hover == 'tooltip') {
                    ?>
imageTooltip<?php 
                }
                ?>
">
                <?php 
                if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') {
Example #16
0
    function etheme_cart_items($limit = 3)
    {
        global $woocommerce;
        if (sizeof($woocommerce->cart->get_cart()) > 0) {
            ?>
			<p><?php 
            _e('Recently added item(s)', ETHEME_DOMAIN);
            ?>
</p>
			<ul class='order-list'>
          <?php 
            $counter = 0;
            foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) {
                $counter++;
                if ($counter > $limit) {
                    continue;
                }
                $_product = $cart_item['data'];
                if (!apply_filters('woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key)) {
                    continue;
                }
                if ($_product->exists() && $cart_item['quantity'] > 0) {
                    $product_price = get_option('woocommerce_display_cart_prices_excluding_tax') == 'yes' || $woocommerce->customer->is_vat_exempt() ? $_product->get_price_excluding_tax() : $_product->get_price();
                    $product_price = apply_filters('woocommerce_cart_item_price_html', woocommerce_price($product_price), $cart_item, $cart_item_key);
                    ?>
					<li>
						<?php 
                    echo apply_filters('woocommerce_cart_item_remove_link', sprintf('<a href="%s" data-key="%s" class="close-order-li" title="%s"></a>', esc_url($woocommerce->cart->get_remove_url($cart_item_key)), $cart_item_key, __('Remove this item', ETHEME_DOMAIN)), $cart_item_key);
                    ?>
						<div class="media">
							<a class="pull-left" href="<?php 
                    echo get_permalink($cart_item['product_id']);
                    ?>
">
								<img class="media-object" src="<?php 
                    echo etheme_get_image(get_post_thumbnail_id($cart_item['product_id']), 70, 200, false);
                    ?>
">
							</a>
							<div class="media-body">
								<h4 class="media-heading"><a href="<?php 
                    echo get_permalink($cart_item['product_id']);
                    ?>
"><?php 
                    echo apply_filters('woocommerce_widget_cart_product_title', $_product->get_title(), $_product);
                    ?>
</a></h4>
								<div class="descr-box">
									<?php 
                    echo $woocommerce->cart->get_item_data($cart_item);
                    ?>
									<span class="coast"><?php 
                    echo $cart_item['quantity'];
                    ?>
 x <span class='medium-coast'><?php 
                    echo $product_price;
                    ?>
</span></span>
								</div>
							</div>
						</div>
					</li>
                <?php 
                }
            }
            ?>
		</ul>

        <?php 
        } else {
            echo '<p class="empty a-center">' . __('No products in the cart.', ETHEME_DOMAIN) . '</p>';
        }
        if (sizeof($woocommerce->cart->get_cart()) > 0) {
            do_action('woocommerce_widget_shopping_cart_before_buttons');
            ?>
			<p class="small-h pull-left"><?php 
            echo __('Cart Subtotal', ETHEME_DOMAIN);
            ?>
</p>
			<span class="big-coast pull-right">
				<?php 
            echo $woocommerce->cart->get_cart_subtotal();
            ?>
			</span>
			<div class="clearfix"></div>
			<div class='bottom-btn'>
				<a href="<?php 
            echo $woocommerce->cart->get_cart_url();
            ?>
" class='btn text-center border-grey'><?php 
            echo __('View Cart', ETHEME_DOMAIN);
            ?>
</a>
				<a href="<?php 
            echo $woocommerce->cart->get_checkout_url();
            ?>
" class='btn text-center big filled'><?php 
            echo __('Checkout', ETHEME_DOMAIN);
            ?>
</a>
			</div>
			
            <?php 
        }
    }
echo $class;
?>
">
	<?php 
do_action('woocommerce_before_shop_loop_item');
?>
        
		<?php 
$placeholder_width = $woocommerce->get_image_size('shop_catalog_image_width');
$placeholder_height = $woocommerce->get_image_size('shop_catalog_image_height');
$catalogImage = get_option('shop_catalog_image_size');
$url = etheme_get_image(false, $catalogImage['width'], $catalogImage['height'], $catalogImage['crop']);
if (has_post_thumbnail()) {
    ?>
                    <a id="<?php 
    echo etheme_get_image(false, 460, 628, false);
    ?>
" href="<?php 
    echo the_permalink();
    ?>
" class="product-image <?php 
    if ($product_img_hover == 'tooltip') {
        ?>
imageTooltip<?php 
    }
    ?>
">
		
						<?php 
    woocommerce_get_template('loop/sale-flash.php');
    ?>
                    <li class="slide">
                        <a href="<?php 
        echo wp_get_attachment_url($id);
        ?>
" class="image" <?php 
        if ($zoom == 'disable') {
            ?>
 rel="lightbox[gal]"<?php 
        }
        ?>
 data-easyzoom-source="<?php 
        echo etheme_get_image($id, $mainWidth, $mainHeight, $crop);
        ?>
">
                            <img src="<?php 
        echo etheme_get_image($id, $thumbImageWidth, $thumbImageHeight, $thumbImageCrop);
        ?>
" >
                        </a>   
						<?php 
        if (etheme_get_option('gallery_lightbox') && $zoom != 'disable') {
            ?>
							<a href="<?php 
            echo wp_get_attachment_url($id);
            ?>
" rel="lightbox[gal]" style="display:none;" data-original-title="" data-placement="left">&nbsp;</a>
						<?php 
        }
        ?>
                    </li>               
                        
Example #19
0
/**
 * Create product slider getting query
 */
function etheme_create_slider($args, $title = false, $image_width = 220, $image_height = 220, $crop = false)
{
    global $wpdb;
    $box_id = rand(1000, 10000);
    $multislides = new WP_Query($args);
    if ($multislides->have_posts()) {
        if ($title) {
            $title_output = '<h2 class="slider-title">' . $title . '</h2>';
        }
        echo '<div class="product-slider">';
        echo $title_output;
        echo '<div class="clear"></div>';
        echo '<div class="carousel">';
        echo '<div class="slider">';
        $_i = 0;
        while ($multislides->have_posts()) {
            $multislides->the_post();
            $_i++;
            if (class_exists('Woocommerce')) {
                global $product;
                if (!$product->is_visible()) {
                    continue;
                }
                echo '<div class="slide product-slide ' . $last . '">';
                woocommerce_get_template_part('content', 'product');
                echo '</div><!-- slide -->';
            }
            if (class_exists('WP_eCommerce')) {
                $post_id = get_the_ID();
                $post_name = get_the_title();
                $post_image = etheme_get_image(null, $image_width, $image_height, $crop, $post_id);
                if (!$post_image && $image_default) {
                    $post_image = $image_default;
                }
                $post_url = get_permalink();
                if (class_exists('WP_eCommerce')) {
                    $normal_price = class_exists('WP_eCommerce') ? the_product_price($post_id) : false;
                    $post_price = class_exists('WP_eCommerce') ? the_product_price($post_id, true) : '';
                }
                echo '<div class="slide product-slide ' . $last . '">';
                echo '<a href="' . $post_url . '" class="product-image"><div class="img-wrapper"><img alt="" src="' . $post_image . '" /></div></a>';
                echo '<span class="product-name"><a href="' . $post_url . '">' . esc_attr($post_name) . '</a></span>';
                if ($normal_price != $post_price) {
                    echo '<div class="price sale">';
                    echo '<p class="oldprice-p pricedisplay"><span class="oldprice">' . $normal_price . '</span></p>';
                    echo '<p class="pricedisplay"><span class="currentprice pricedisplay">' . $post_price . '</span></p>';
                    echo '</div> ';
                } else {
                    echo '<div class="price">';
                    echo '<span>' . $post_price . '</span>';
                    echo '</div>';
                }
                wpsc_the_product();
                if (wpsc_product_external_link($post_id) != '') {
                    $action = wpsc_product_external_link($post_id);
                } else {
                    $action = htmlentities(wpsc_this_page_url(), ENT_QUOTES, 'UTF-8');
                }
                echo '<div class="btn-cont">';
                echo '<form class="product_form"  enctype="multipart/form-data" action="' . $action . '" method="post" name="product_' . $post_id . '" id="product_' . $post_id . '" >';
                echo '<input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>';
                echo '<input type="hidden" value="' . $post_id . '" name="product_id"/>';
                if (false) {
                    echo '<button class="button" type="submit" id="product_' . $post_id . '_submit_button"><span>' . __('Add To Cart', 'wpsc') . '</span></button>';
                } else {
                    echo '<a href="' . $post_url . '" class="button add-to-cart sml"><span>' . __('Read more', 'wpsc') . '</span></a>';
                }
                echo '</form>';
                echo '</div>';
                echo '</div><!-- slide -->';
            }
            unset($last);
        }
        echo '</div><!-- slider -->';
        echo '</div><!-- carousel -->';
        if ($_i > 1) {
            echo '<div class="prev arrow' . $box_id . '" style="cursor: pointer; ">&nbsp;</div>';
            echo '<div class="next arrow' . $box_id . '" style="cursor: pointer; ">&nbsp;</div>';
        }
        echo '</div><!-- product-slider -->';
    }
    wp_reset_query();
    if (@$_i > 1) {
        echo '
            <script type="text/javascript">
                jQuery(".arrow' . $box_id . '.prev").addClass("disabled");
                jQuery(".carousel").iosSlider({
                    desktopClickDrag: true,
                    snapToChildren: true,
                    infiniteSlider: false,
                    navNextSelector: ".arrow' . $box_id . '.next",
                    navPrevSelector: ".arrow' . $box_id . '.prev",
                    lastSlideOffset: 3,
                    onFirstSlideComplete: function(){
                        jQuery(".arrow' . $box_id . '.prev").addClass("disabled");
                    },
                    onLastSlideComplete: function(){
                        jQuery(".arrow' . $box_id . '.next").addClass("disabled");
                    },
                    onSlideChange: function(){
                        jQuery(".arrow' . $box_id . '.next").removeClass("disabled");
                        jQuery(".arrow' . $box_id . '.prev").removeClass("disabled");
                    }
                });
            </script>
        ';
    }
}
Example #20
0
                  </script>
              <?php 
    }
    ?>
      
    <?php 
} elseif (has_post_thumbnail()) {
    ?>
      <div class="wp-picture">
        <?php 
    the_post_thumbnail('large');
    ?>
        <div class="zoom">
          <div class="btn_group">
            <a href="<?php 
    echo etheme_get_image();
    ?>
" class="btn btn-black xmedium-btn" rel="pphoto"><span><?php 
    _e('View large', ETHEME_DOMAIN);
    ?>
</span></a>
            <a href="<?php 
    the_permalink();
    ?>
" class="btn btn-black xmedium-btn"><span><?php 
    _e('More details', ETHEME_DOMAIN);
    ?>
</span></a>
          </div>
          <i class="bg"></i>
        </div>
Example #21
0
        function vc_theme_vc_row($atts, $content = null)
        {
            $output = $section_class = $el_class = $video = $bg_image = $bg_color = $full_width = $bg_image_repeat = $font_color = $padding = $margin_bottom = $css = '';
            extract(shortcode_atts(array('el_class' => '', 'full_width' => 0, 'bg_image' => '', 'bg_color' => '', 'bg_image_repeat' => '', 'font_color' => '', 'color_scheme' => '', 'padding' => '', 'margin_bottom' => '', 'parallax' => 0, 'video_poster' => '', 'video_mp4' => '', 'video_webm' => '', 'video_ogv' => '', 'css' => '', 'css_outer' => ''), $atts));
            wp_enqueue_style('js_composer_front');
            wp_enqueue_script('wpb_composer_front_js');
            wp_enqueue_style('js_composer_custom_css');
            $el_class = ' ' . $el_class;
            $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'row-fluid ' . get_row_css_class() . $el_class . vc_shortcode_custom_css_class($css, ' '));
            $style = buildStyle($bg_image, $bg_color, $bg_image_repeat, $font_color, $padding, $margin_bottom);
            if ($full_width) {
                $section_class .= ' color-scheme-' . $color_scheme . ' ';
                if ($parallax) {
                    $section_class .= ' parallax-section';
                }
                if ($video_mp4 != '' || $video_webm != '' || $video_ogv != '') {
                    if ($video_poster != '') {
                        $video_poster = etheme_get_image($video_poster);
                        $video .= '
			                <div class="section-video-poster" style="background-image: url(' . $video_poster . ')"></div>
			            ';
                    }
                    $video .= '
			        <div class="section-back-video hidden-tablet hidden-phone">
			            <video autoplay="autoplay" loop="loop" muted="muted" style="" class="et-section-video">
			                <source src="' . $video_mp4 . '" type="video/mp4">
			                <source src="' . $video_ogv . '" type="video/ogv">
			                <source src="' . $video_webm . '" type="video/webm">
			            </video>
			        </div>
			        <div class="section-video-mask"></div>
			        ';
                }
                $output .= '<div class="et_section ' . vc_shortcode_custom_css_class($css_outer, ' ') . $section_class . '" data-parallax-speed="0.1">' . $video . '<div class="container">';
            }
            $output .= '<div class="' . $css_class . '"' . $style . '>';
            $output .= wpb_js_remove_wpautop($content);
            $output .= '</div>';
            if ($full_width) {
                $output .= '</div></div>';
            }
            return $output;
        }
Example #22
0
        function vc_theme_vc_video($atts)
        {
            $output = $title = $link = $size = $el_class = $img_src = '';
            extract(shortcode_atts(array('title' => '', 'link' => 'http://vimeo.com/23237102', 'size' => isset($content_width) ? $content_width : 500, 'popup' => 'no', 'img' => '', 'img_size' => '300x200', 'el_class' => '', 'css' => ''), $atts));
            if ($link == '') {
                return null;
            }
            $src = '';
            if ($popup == 'yes') {
                $img_size = explode('x', $img_size);
                $width = $img_size[0];
                $height = $img_size[1];
                if ($img != '') {
                    $src = etheme_get_image($img, $width, $height);
                } elseif ($img_src != '') {
                    $src = do_shortcode($img_src);
                }
                $text = __('Show video', ETHEME_DOMAIN);
                if ($src != '') {
                    $text = '<img src="' . $src . '">';
                }
            }
            $video_w = isset($content_width) ? $content_width : 500;
            $video_h = $video_w / 1.61;
            //1.61 golden ratio
            global $wp_embed;
            $embed = $wp_embed->run_shortcode('[embed width="' . $video_w . '"' . $video_h . ']' . $link . '[/embed]');
            $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_video_widget wpb_content_element' . $el_class . $el_class . vc_shortcode_custom_css_class($css, ' '), 'vc_video');
            $rand = rand(1000, 9999);
            $css_class .= ' video-' . $rand;
            $output .= "\n\t" . '<div class="' . $css_class . '">';
            $output .= "\n\t\t" . '<div class="wpb_wrapper">';
            $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_video_heading'));
            if ($popup == 'yes') {
                $output .= '<a href="#" class="open-video-popup">' . $text . '</a>';
                $output .= "\n\t" . '<script type="text/javascript">';
                $output .= "\n\t\t" . 'jQuery(document).ready(function() {
						    jQuery(".video-' . $rand . ' .open-video-popup").magnificPopup({
							    items: [
							      {
							        src: "' . $link . '",
							        type: "iframe" 
							      },
							    ],
						    });
					    });';
                $output .= "\n\t" . '</script> ';
            } else {
                $output .= '<div class="wpb_video_wrapper">' . $embed . '</div>';
            }
            $output .= "\n\t\t" . '</div> ';
            $output .= "\n\t" . '</div> ';
            return $output;
        }
Example #23
0
 function etheme_replace_variation_images($variations, $width = 1000, $height = 1000, $crop = false)
 {
     $newVariations = $variations;
     foreach ($variations as $key => $value) {
         $attachment_id = get_post_thumbnail_id($variations[$key]['variation_id']);
         $newImage = etheme_get_image($attachment_id, $width, $height, $crop);
         $newVariations[$key]['image_src'] = $newImage;
     }
     return $newVariations;
 }
Example #24
0
    function widget($args, $instance)
    {
        $cache = wp_cache_get('etheme_widget_recent_entries', 'widget');
        if (!is_array($cache)) {
            $cache = array();
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', ETHEME_DOMAIN) : $instance['title']);
        $number = 10;
        if (isset($instance['number']) && !($number = (int) $instance['number'])) {
            $number = 10;
        } else {
            if ($number < 1) {
                $number = 1;
            } else {
                if ($number > 15) {
                    $number = 15;
                }
            }
        }
        $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1));
        if ($r->have_posts()) {
            ?>
        <?php 
            echo $before_widget;
            ?>
        <?php 
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
            <ul>
                <?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
                    <li>
                        <?php 
                $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), array(130, 130));
                $url = $thumb[0];
                if ($url && $url != '') {
                    ?>
                            <a class="postimg" href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                    ?>
"><img src="<?php 
                    echo etheme_get_image(false, 60, 60);
                    ?>
" /></a>
                            
                        <?php 
                }
                ?>
                        <?php 
                if (get_the_title()) {
                    $title = get_the_title();
                } else {
                    $title = get_the_ID();
                }
                $word_nubmers = 20;
                $title = explode(" ", $title);
                if (count($title) > $word_nubmers) {
                    $points = '...';
                } else {
                    $points = '';
                }
                $title = array_chunk($title, $word_nubmers);
                $title = implode(" ", $title[0]) . $points;
                ?>
                        <a href="<?php 
                the_permalink();
                ?>
" <?php 
                if (!$url || $url == '') {
                    echo 'style="width:100%;"';
                }
                ?>
 title="<?php 
                echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                ?>
">
                            <?php 
                echo $title;
                ?>
 
                        </a><br />
                        <span class="recent-posts-2-author"><?php 
                the_author();
                ?>
 <?php 
                the_date('F j, Y', '/ ');
                ?>
</span>
                        <div class="clear"></div>
                    </li>
                <?php 
            }
            ?>
            </ul>
        <?php 
            echo $after_widget;
            wp_reset_query();
            // Restore global post data stomped by the_post().
        }
        $cache[$args['widget_id']] = ob_get_flush();
        wp_cache_add('etheme_widget_recent_entries', $cache, 'widget');
    }
Example #25
0
    function etheme_cart_items($limit = 3)
    {
        global $woocommerce;
        if (sizeof($woocommerce->cart->get_cart()) > 0) {
            ?>
            <div class="products-small">
          <?php 
            $counter = 0;
            foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) {
                $counter++;
                if ($counter > $limit) {
                    continue;
                }
                $_product = $cart_item['data'];
                if (!apply_filters('woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key)) {
                    continue;
                }
                if ($_product->exists() && $cart_item['quantity'] > 0) {
                    $product_price = get_option('woocommerce_display_cart_prices_excluding_tax') == 'yes' || $woocommerce->customer->is_vat_exempt() ? $_product->get_price_excluding_tax() : $_product->get_price();
                    $product_price = apply_filters('woocommerce_cart_item_price_html', woocommerce_price($product_price), $cart_item, $cart_item_key);
                    ?>
                    <div class="product-item">       
                        <a href="<?php 
                    echo get_permalink($cart_item['product_id']);
                    ?>
" class="product-image">
                            <img src="<?php 
                    echo etheme_get_image(get_post_thumbnail_id($cart_item['product_id']), 100, 200, false);
                    ?>
">
                        </a>
                        <?php 
                    echo apply_filters('woocommerce_cart_item_remove_link', sprintf('<a href="%s" data-key="%s" class="delete-btn" title="%s"><i class="icon-remove"></i></a>', esc_url($woocommerce->cart->get_remove_url($cart_item_key)), $cart_item_key, __('Remove this item', ETHEME_DOMAIN)), $cart_item_key);
                    ?>
                        <h5><a href="<?php 
                    echo get_permalink($cart_item['product_id']);
                    ?>
"><?php 
                    echo apply_filters('woocommerce_widget_cart_product_title', $_product->get_title(), $_product);
                    ?>
</a></h5>
                        
                        <div class="qty">
                            <span class="price"><span class="pricedisplay"><?php 
                    echo $product_price;
                    ?>
</span></span>
                            <span class="quanity-label"><?php 
                    echo __('Qty', ETHEME_DOMAIN);
                    ?>
:</span> <span><?php 
                    echo $cart_item['quantity'];
                    ?>
</span>
                        	<?php 
                    echo $woocommerce->cart->get_item_data($cart_item);
                    ?>
                        </div>
                        
                        <div class="clear"></div>
                    </div> 
                <?php 
                }
            }
            ?>
        </div>

        <?php 
        } else {
            echo '<p class="empty a-center">' . __('No products in the cart.', ETHEME_DOMAIN) . '</p>';
        }
        if (sizeof($woocommerce->cart->get_cart()) > 0) {
            ?>
            <div class="totals">
            	<span class="items left"><?php 
            echo $woocommerce->cart->cart_contents_count;
            ?>
 <?php 
            _e('items', ETHEME_DOMAIN);
            ?>
</span>
                <?php 
            echo __('Total:', ETHEME_DOMAIN);
            ?>
 &nbsp;<span class="price"><span class="pricedisplay"><?php 
            echo $woocommerce->cart->get_cart_subtotal();
            ?>
</span></span>
            </div>
          <?php 
            do_action('woocommerce_widget_shopping_cart_before_buttons');
            ?>
                
                <a href="<?php 
            echo $woocommerce->cart->get_cart_url();
            ?>
" class="button left"><span><?php 
            echo __('View Cart', ETHEME_DOMAIN);
            ?>
</span></a>  
                <a href="<?php 
            echo $woocommerce->cart->get_checkout_url();
            ?>
" class="button filled active right "><span><?php 
            echo __('Checkout', ETHEME_DOMAIN);
            ?>
</span></a>   

                <div class="clear"></div>
            
            <?php 
        }
    }