Пример #1
0
    return;
}
if (isset($woocommerce_loop['loop'])) {
    $woocommerce_loop['loop']++;
} else {
    $woocommerce_loop['loop'] = 0;
}
/** image **/
$itemwidth = vp_option('joption.product_width', 500);
$itw = $itemwidth * 1.5;
$ith = null;
if (vp_option('joption.product_type', 'normal') == 'normal') {
    $ith = $itw * floatval(vp_option('joption.item_height'));
}
$image = jeg_get_image_attachment(get_post_thumbnail_id($product->id));
$thumbnail = jeg_image_resizer($image, $itw, $ith);
/** category **/
$terms = get_the_terms($product->id, 'product_cat');
$termarray = array();
if (!empty($terms)) {
    foreach ($terms as $term) {
        $termarray[] = $term->name;
        break;
    }
}
/** margin size **/
$marginsize = 0;
if (vp_option('joption.product_use_margin', 0) == 1) {
    $marginsize = vp_option('joption.product_margin_size', 5);
}
?>
Пример #2
0
if (sizeof($woocommerce->cart->get_cart()) > 0) {
    ?>
                    <h6 class="topcartheader"><?php 
    echo sprintf(_n('An Item', '%s Items', $itemcount, 'jeg_textdomain'), $itemcount);
    ?>
 on Shopping Cart</h6>
                    <div class="topcartlist">
                        <?php 
    foreach ($woocommerce->cart->get_cart() as $cart_item_key => $values) {
        $_product = $values['data'];
        if ($_product->exists() && $values['quantity'] > 0) {
            ?>
                                <div class="topcartlist_product">
                                    <?php 
            $image = jeg_get_image_attachment(get_post_thumbnail_id($_product->id));
            $thumbnail = jeg_image_resizer($image, 65, 79);
            printf('<a href="%s" class="topcartlist_image"><img src="%s" alt="%s"/></a>', esc_url(get_permalink(apply_filters('woocommerce_in_cart_product_id', $values['product_id']))), $thumbnail, $_product->post->post_title);
            ?>
                                    <div class="topcart_desc">
                                        <a href="<?php 
            echo esc_url(get_permalink(apply_filters('woocommerce_in_cart_product_id', $values['product_id'])));
            ?>
"><strong><?php 
            echo $_product->post->post_title;
            ?>
</strong></a>
                                        <span><?php 
            _e('Quantity :', 'jeg_textdomain');
            ?>
 <?php 
            echo $values['quantity'];
Пример #3
0
	<div class="slideshowgallery" style='opacity: 0;' data-loop="true" data-autoplay="<?php 
    echo vp_metabox('jkreativ_page_slidermedia.toggle_autoplay') === "1" ? vp_metabox('jkreativ_page_slidermedia.autoplay_delay') : false;
    ?>
">
		<?php 
    $mediagallery = get_post_meta(get_the_ID(), 'postgallery', true);
    foreach ($mediagallery as $key => $value) {
        if ($value['type'] === 'image') {
            $image = jeg_get_image_attachment($value['imageid']);
            $thumbnail = jeg_image_resizer($image, 144, 96);
            echo "<a href='{$image}'><img src='{$thumbnail}' width='144' height='96'></a>";
        } else {
            if ($value['type'] === 'youtube' || $value['type'] === 'vimeo') {
                $mediaurl = $value['mediaurl'];
                $image = jeg_get_image_attachment($value['mediacover']);
                $thumbnail = jeg_image_resizer($image, 144, 96);
                echo "<a href='{$mediaurl}' data-img='{$image}'><img src='{$thumbnail}' width='144' height='96'></a>";
            }
        }
    }
    ?>
	</div>
</div>
<div class="sliderloader bigloader"></div>

<script>
	(function($){
		$(document).ready(function(){
			/** Full screen **/
			if($(".fs-container").length) {
				$(".fs-container").fsfullheight(['.headermenu', '.responsiveheader', '.topnavigation']);
function jeg_product_slider($atts, $content = null)
{
    $atts = shortcode_atts(array('number' => '', 'column' => '', 'filter_category' => array(), 'image_dimension' => '', 'class' => ''), $atts);
    $productquery = array('post_type' => 'product', 'posts_per_page' => $atts['number'], 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')));
    if (!empty($atts['filter_category'])) {
        $productquery['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $atts['filter_category'], 'field' => 'id', 'operator' => 'IN'));
    }
    ob_start();
    $products = new WP_Query(apply_filters('woocommerce_shortcode_products_query', $productquery, $atts));
    if ($products->have_posts()) {
        while ($products->have_posts()) {
            $products->the_post();
            global $product;
            // product image
            $productimage = jeg_get_image_attachment(get_post_thumbnail_id($product->id));
            $defaultwidth = 600;
            $thumbnail = jeg_image_resizer($productimage, $defaultwidth, $defaultwidth * $atts['image_dimension']);
            // category
            $terms = get_the_terms($product->id, 'product_cat');
            $termarray = array();
            if (!empty($terms)) {
                foreach ($terms as $term) {
                    $link = get_term_link($term);
                    $termarray[] = "<a href='{$link}'>" . $term->name . "</a>";
                    break;
                }
            }
            $additionalcss = '';
            global $is_safari;
            if (!wp_is_mobile() && !$is_safari) {
                $additionalcss = " jeg_do_animate ";
            }
            ?>
			<div class='<?php 
            $additionalcss;
            ?>
 item'>
				<div class='product-item'>
					<div class='product-cover'>
						<img src='<?php 
            echo $thumbnail;
            ?>
' alt='<?php 
            echo get_the_title();
            ?>
'>
					</div>
					<span class='product-category'><?php 
            echo implode(', ', $termarray);
            ?>
</span>
					<a href='<?php 
            echo get_the_permalink();
            ?>
'>
						<h3><?php 
            echo get_the_title();
            ?>
</h3>
					</a>
					<span class="product-line"></span>
			<?php 
            $rating = '';
            if (get_option('woocommerce_enable_review_rating') !== 'no') {
                $count = $product->get_rating_count();
                $average = $product->get_average_rating();
                if ($count > 0) {
                    ?>
					<div class="review-box">
						<div itemprop="ratingValue" title="<?php 
                    echo sprintf(__('Rated %.2f out of 5', 'jeg_textdomain'), $average);
                    ?>
" class="star-rating">
							<span style="width:<?php 
                    echo $average / 5 * 100;
                    ?>
%"></span>
						</div>
					</div>
			<?php 
                }
            }
            ?>
					<div class='price'>
						<span class='amount'><?php 
            echo $product->get_price_html();
            ?>
</span>
					</div>
				</div>
			</div>
			<?php 
        }
    }
    wp_reset_postdata();
    $additionalcss = '';
    global $is_safari;
    if (!wp_is_mobile() && !$is_safari) {
        $additionalcss = " jeg_animate_sequence jeg_animate_slow ";
    }
    return "<div data-column='{$atts['column']}' class='{$atts['class']} woocommerce jkreativ-woocommerce product-slide {$additionalcss} grab' data-position='0' data-speed='300' data-animation='janimate-fadein'>\r\n\t\t" . ob_get_clean() . "\r\n\t</div>";
}
 function jeg_get_portfolio_featured_heading($postid)
 {
     $portfolioitem = get_post_meta($postid, 'jkreativ_portfolio_gallery', true);
     $featured = '';
     if (!empty($portfolioitem)) {
         foreach ($portfolioitem as $idx => $portfolio) {
             $portfoliotype = $portfolio['type'];
             $loadclass = $idx === 0 ? "loaded" : "notloaded";
             $mediacover = '';
             if (isset($portfolio['mediacover'])) {
                 $mediacover = jeg_get_image_attachment($portfolio['mediacover']);
                 $mediacoversize = wp_get_attachment_image_src($portfolio['mediacover'], 'full');
             }
             switch ($portfoliotype) {
                 case 'image':
                     $image = wp_get_attachment_image_src($portfolio['imageid'], 'full');
                     $thumb = jeg_image_resizer($image[0], 90, 90);
                     if ($idx === 0) {
                         $featured .= "<div class='portfolio-content-holder item' data-type='image' data-title='{$portfolio['imagename']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<img src='{$image[0]}' class='{$loadclass}' data-width='{$image[1]}' data-height='{$image[2]}'/>\r\n\t\t\t\t\t\t\t</div>";
                     } else {
                         $featured .= "<div class='portfolio-content-holder item' data-type='image' data-title='{$portfolio['imagename']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<img src='' data-src='{$image[0]}' class='{$loadclass}' data-width='{$image[1]}' data-height='{$image[2]}'/>\r\n\t\t\t\t\t\t\t</div>";
                     }
                     break;
                 case 'youtube':
                 case 'vimeo':
                     $thumb = jeg_image_resizer($mediacover, 90, 90);
                     if ($idx === 0) {
                         $featured .= "<div class='portfolio-content-holder item' data-type='{$portfoliotype}' data-src='{$portfolio['mediaurl']}' data-title='{$portfolio['title']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-wrapper'>\r\n\t\t\t\t\t\t\t\t\t<img src='{$mediacover}' class='{$loadclass}' data-width='{$mediacoversize[1]}' data-height='{$mediacoversize[2]}'/>\r\n\t\t\t\t\t\t\t\t\t<div class='videooverlay'></div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-container'><div class='video-container'></div></div>\r\n\t\t\t\t\t\t\t</div>";
                     } else {
                         $featured .= "<div class='portfolio-content-holder item' data-type='{$portfoliotype}' data-src='{$portfolio['mediaurl']}' data-title='{$portfolio['title']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-wrapper'>\r\n\t\t\t\t\t\t\t\t\t<img src='' data-src='{$mediacover}' class='{$loadclass}' data-width='{$mediacoversize[1]}' data-height='{$mediacoversize[2]}'/>\r\n\t\t\t\t\t\t\t\t\t<div class='videooverlay'></div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-container'><div class='video-container'></div></div>\r\n\t\t\t\t\t\t\t</div>";
                     }
                     break;
                 case 'html5video':
                     $thumb = jeg_image_resizer($mediacover, 90, 90);
                     if ($idx === 0) {
                         $featured .= "<div class='portfolio-content-holder item' data-type='{$portfoliotype}' data-mp4='{$portfolio['videomp4']}' data-webm='{$portfolio['videowebm']}' data-ogg='{$portfolio['videoogg']}' data-title='{$portfolio['title']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-wrapper'>\r\n\t\t\t\t\t\t\t\t\t<img src='{$mediacover}' class='{$loadclass}' data-width='{$mediacoversize[1]}' data-height='{$mediacoversize[2]}'/>\r\n\t\t\t\t\t\t\t\t\t<div class='videooverlay'></div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-container'><div class='html5-video-container'></div></div>\r\n\t\t\t\t\t\t\t</div>";
                     } else {
                         $featured .= "<div class='portfolio-content-holder item' data-type='{$portfoliotype}' data-cover='{$mediacover}' data-mp4='{$portfolio['videomp4']}' data-webm='{$portfolio['videowebm']}' data-ogg='{$portfolio['videoogg']}' data-title='{$portfolio['title']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-wrapper'>\r\n\t\t\t\t\t\t\t\t\t<img src='' data-src='{$mediacover}' class='{$loadclass}' data-width='{$mediacoversize[1]}' data-height='{$mediacoversize[2]}'/>\r\n\t\t\t\t\t\t\t\t\t<div class='videooverlay'></div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div class='portfoliovideo-container'><div class='html5-video-container'></div></div>\r\n\t\t\t\t\t\t\t</div>";
                     }
                     break;
                 case 'soundcloud':
                     $thumb = jeg_image_resizer($mediacover, 90, 90);
                     $featured .= "<div class='portfolio-content-holder item' data-type='soundcloud' data-src='{$portfolio['mediaurl']}' data-title='{$portfolio['title']}' data-thumb='{$thumb}'>\r\n\t\t\t\t\t\t\t<div class='video-container'></div>\r\n\t\t\t\t\t\t</div>";
                     break;
                 default:
                     break;
             }
         }
     }
     return $featured;
 }
				<?php 
foreach ($ps as $pslider) {
    if ($pslider['ps_show_video']) {
        $pslider['textposition'] = '';
    }
    ?>
					<div class="text-wrapper">
			 			<div class="container jcontainer <?php 
    echo $pslider['textposition'];
    ?>
">
			 				<div class="row-fluid">
			 					<?php 
    if ($pslider['ps_show_video']) {
        $imageposter = jeg_get_image_attachment($pslider['ps_video'][0]['ps_video_image']);
        $poster = jeg_image_resizer($imageposter, 1200, 900);
        ?>
			 									 					
									<div class="slider-video span6 ">
										
										<?php 
        if ($pslider['ps_video'][0]['ps_video_type'] === 'youtube') {
            ?>
											
										<a class="imggalitem jvideo" data-video-type="<?php 
            echo $pslider['ps_video'][0]['ps_video_type'];
            ?>
" href="<?php 
            echo $pslider['ps_video'][0]['ps_video_youtube'];
            ?>
">
Пример #7
0
function vc_theme_jeg_portfolio_item($atts)
{
    $atts = shortcode_atts(array('id' => '', 'image' => '', 'blockwidth' => '', 'blockheight' => ''), $atts);
    $post = get_post($atts['id']);
    $termlist = get_the_terms($post->ID, JEG_PORTFOLIO_CATEGORY);
    $termstring = array();
    if ($termlist) {
        foreach ($termlist as $term) {
            $termstring[] = $term->name;
        }
    }
    $blockwidth = 0;
    $blockheight = 0;
    switch ($atts['blockwidth']) {
        case '1/3':
            $blockwidth = 383;
            break;
        case '1/2':
            $blockwidth = 516;
            break;
        case '2/3':
            $blockwidth = 776;
            break;
    }
    switch ($atts['blockheight']) {
        case '1':
            $blockheight = 387;
            break;
        case '2':
            $blockheight = 784;
            break;
    }
    if (empty($atts['image'])) {
        $imageurl = jeg_get_image_attachment(get_post_meta($atts['id'], "coverimage", true));
    } else {
        $imageurl = $atts['image'];
        if (ctype_digit($imageurl) || is_int($imageurl)) {
            $imageurl = jeg_get_image_attachment($atts['image']);
        }
    }
    $image = jeg_image_resizer($imageurl, $blockwidth, $blockheight);
    $additionalcss = '';
    if (!wp_is_mobile()) {
        $additionalcss = " jeg_do_animate ";
    }
    return "<div class='landingmasonryitem {$additionalcss}' data-animation='janimate-fadein' data-width='{$atts['blockwidth']}' data-height='{$atts['blockheight']}'>\n\t\t<a href='" . get_page_link($atts['id']) . "'>\n\t\t\t<img src='{$image}' alt=''>\n\t\t\t<div class='mask'>\n\t\t\t\t<div class='info'>\n\t\t\t\t\t<h2>" . $post->post_title . "</h2>\n\t\t\t\t\t<span></span>\n\t\t\t\t\t<p>" . implode(', ', $termstring) . "</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</a>\n\t</div>\t";
}