function etheme_get_color($key) { $color = etheme_get_option($key); if ($color && $color != '#') { return $color; } else { return false; } }
<?php /** * Product Loop Start * * @author WooThemes * @package WooCommerce/Templates * @version 2.0.0 */ global $woocommerce_loop; // Store column count for displaying the grid $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', etheme_get_option('prodcuts_per_row')); $columns = $woocommerce_loop['columns']; if (!empty($woocommerce_loop['shortcode_columns'])) { $columns = $woocommerce_loop['shortcode_columns']; } $view_mode = etheme_get_option('view_mode'); if ($view_mode == 'list' || $view_mode == 'list_grid') { $view_class = 'products-list'; } else { $view_class = 'products-grid'; } ?> <div class="product-loop <?php echo $view_class; ?> product-count-<?php echo $columns; ?> ">
<?php while (have_posts()) { the_post(); ?> <?php woocommerce_get_template_part('content', 'product'); ?> <?php } // end of the loop. ?> <?php if (etheme_get_option('product_img_hover') == 'tooltip') { ?> <script type="text/javascript">imageTooltip(jQuery('.imageTooltip'));</script> <?php } ?> <div class="clear"></div> <?php woocommerce_product_loop_end(); ?> <div class="toolbar toolbar-bottom"> <?php /**
<?php /** * Single Product Thumbnails */ global $post, $product, $woocommerce; $product_layout = etheme_get_option('single_product_layout'); $zoom = etheme_get_option('zoom_efect'); $thums_count = etheme_get_option('thumbs_count'); $crop = get_option('woocommerce_single_image_crop') == 1 ? true : false; $mainHeight = 600; $mainWidth = 440; $attachment_ids = $product->get_gallery_attachment_ids(); if ($attachment_ids) { ?> <div class="views-gallery thumbs-count-<?php echo $thums_count; ?> "> <ul class="slider <?php if (count($attachment_ids) > 3 && $product_layout == 'variant3') { ?> jcarousel-horizontal<?php } ?> "> <li class="slide thumbnail-active"> <a href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?> " class="image" <?php
<?php /** * Related Products * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $product, $woocommerce_loop; //$related = $product->get_related(20); $product_per_row = etheme_get_option('product_per_row'); //if ( sizeof($related) == 0 ) return; /* $args = apply_filters('woocommerce_related_products_args', array( 'post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => 20, 'orderby' => $orderby, 'post__in' => $related ) ); */ $termekszin = wp_get_post_terms($product->id, 'pa_szin'); foreach ($termekszin as $s) { $sz[] = $s->term_id; }
function get_etheme_portfolio($categories = false, $limit = false, $show_pagination = true) { $paged = get_query_var('paged') ? get_query_var('paged') : 1; $tax_query = array(); if (!$limit) { $limit = etheme_get_option('portfolio_count'); } if (is_array($categories) && !empty($categories)) { $tax_query = array(array('taxonomy' => 'categories', 'field' => 'id', 'terms' => $categories, 'operator' => 'IN')); } else { if (!is_array($categories) && !empty($categories)) { $categories = explode(',', $categories); $tax_query = array(array('taxonomy' => 'categories', 'field' => 'id', 'terms' => $categories, 'operator' => 'IN')); } } $args = array('post_type' => 'etheme_portfolio', 'paged' => $paged, 'posts_per_page' => $limit, 'tax_query' => $tax_query); $loop = new WP_Query($args); if ($loop->have_posts()) { ?> <div> <ul class="portfolio-filters"> <li><a href="#" data-filter="*" class="button active"><?php _e('Show All', ETHEME_DOMAIN); ?> </a></li> <?php $categories = get_terms('categories', array('include' => $categories)); $catsCount = count($categories); $_i = 0; foreach ($categories as $category) { $_i++; ?> <li><a href="#" data-filter=".sort-<?php echo $category->slug; ?> " class="button"><?php echo $category->name; ?> </a></li> <?php } ?> </ul> <div class="row portfolio masonry"> <?php while ($loop->have_posts()) { $loop->the_post(); ?> <?php get_template_part('content', 'portfolio'); ?> <?php } ?> </div> </div> <?php if ($show_pagination) { ?> <?php etheme_portfolio_pagination($loop, $paged); ?> <?php } ?> <?php } else { ?> <h3><?php _e('No pages were found!', ETHEME_DOMAIN); ?> </h3> <?php } }
<div class="clear"></div> <!--<div class="menu_above"> <div class="home active"> <a href="/"><span class="icon i-home"> <span class="s-visuallyhidden">Trang chủ</span></span></a> </div> </div>--> <div class="clear"></div> <?php $logoimg = etheme_get_option('logo'); ?> <style>.logo h1 a { display: block; background: url('<?php echo $logoimg; ?> ') no-repeat; background-size: 200px auto; width: 280px; height: 100px; text-indent: -99999px; margin-top: -1px;} </style> <div class="logo"> <?php
/** * Simple product add to cart * * @author WooThemes * @package WooCommerce/Templates * @version 2.1.0 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $woocommerce, $product; if (!$product->is_purchasable()) { return; } $ajax_addtocart = etheme_get_option('ajax_addtocart'); ?> <div class="addto-container"> <?php if ($product->is_in_stock()) { ?> <?php do_action('woocommerce_before_add_to_cart_form'); ?> <form class="cart" method="post" enctype='multipart/form-data'> <?php do_action('woocommerce_before_add_to_cart_button');
<div class="collapse navbar-collapse"> <?php et_get_main_menu(); ?> </div><!-- /.navbar-collapse --> </div> <div class="header-logo"> <?php etheme_logo(); ?> </div> <div class="tbs navmenu-right"> <div class="collapse navbar-collapse"> <?php et_get_main_menu('main-menu-right'); ?> </div><!-- /.navbar-collapse --> </div> </div><!-- /.container-fluid --> </div> </div> </header> <?php if (etheme_get_option('header_type') == 'vertical' || etheme_get_option('header_type') == 'vertical2') { ?> </div> <?php } ?> </div>
</style> <script type="text/javascript"> var active_color_selector = '<?php echo jsString($selectors['active_color']); ?> '; var active_bg_selector = '<?php echo jsString($selectors['active_bg']); ?> '; var active_border_selector = '<?php echo jsString($selectors['active_border']); ?> '; var active_color_default = '<?php echo etheme_get_option('activecol') ? etheme_get_option('activecol') : '#ff4949'; ?> '; var bg_default = '#ffffff'; var pattern_default = '<?php etheme_option('background_img'); ?> '; var isRequired = ' <?php _e('Please, fill in the required fields!', ETHEME_DOMAIN); ?> '; var cartHref = '<?php echo class_exists('WooCommerce') ? $woocommerce->cart->get_cart_url() : ''; ?>
<?php $blog_layout = etheme_get_option('blog_layout'); $blog_sidebar = etheme_get_option('blog_sidebar'); get_header(); ?> <section id="main" class="columns2-<?php echo $blog_sidebar; ?> blog-<?php echo $blog_layout; ?> "> <div class="content"> <?php if (have_posts()) { ?> <h3 class="page-title"> <?php if (is_day()) { ?> <?php printf(__('Daily Archives: %s', ETHEME_DOMAIN), '<span>' . get_the_date() . '</span>'); ?> <?php } elseif (is_month()) { ?> <?php printf(__('Monthly Archives: %s', ETHEME_DOMAIN), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', ETHEME_DOMAIN)) . '</span>'); ?> <?php
etheme_logo(); ?> </div> <div class="col-md-4 hidden-phone hidden-tablet"> <div class="col-md-12"> <div class="col-md-7"> </div> <div class="col-md-5 hidden-phone hidden-tablet" style="padding-top:12.5%"> <div class="col-md-4" style="padding:0px;padding-top:2px"> <span data-toggle="modal" data-target="#searchModal" class="fa fa-search"></span> </div> <div class="col-md-1" style="width: 3px; height: 25px; background: black;padding:0px;margin-left:6px"></div> <div class="col-md-6" style="padding:0px"> <?php if (class_exists('Woocommerce') && !etheme_get_option('just_catalog') && etheme_get_option('cart_widget')) { ?> <?php etheme_top_cart(); ?> <?php } ?> </div> </div> </div> </div> </div> <div class="menu-icon hidden-desktop"><i class="icon-reorder"></i></div> </div>
?> successfullyAdded2 = '<?php _e('was successfully added to your shopping cart.', ETHEME_DOMAIN); ?> <div class="clear"><a class="button cont-shop"><span><?php _e('Continue Shopping', ETHEME_DOMAIN); ?> </span></a><a href="<?php echo WC()->cart->get_cart_url(); ?> " class="button fl-r"><span><?php _e('Checkout', ETHEME_DOMAIN); ?> </span></a></div>'; <?php if (etheme_get_option('nice_scroll')) { ?> jQuery(document).ready(function(){ jQuery("html").niceScroll({ hidecursordelay: 100000, scrollspeed: 40 }); }); <?php } ?> <?php } ?> </script>
<?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?> <?php } ?> <?php do_action('woocommerce_after_checkout_billing_form', $checkout); ?> <?php if (etheme_get_option('checkout_page') == 'stepbystep') { ?> <a href="#" class="button active fl-r continue-checkout" data-next="4"><?php _e('Continue', ETHEME_DOMAIN); ?> </a> <?php } else { ?> <?php if (!is_user_logged_in() && $checkout->enable_signup) { ?> <?php if ($checkout->enable_guest_checkout) {
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"> </a> <?php } ?> </li> <?php } ?> </ul> </div>
</h6> </div> <?php } elseif ($post_format == 'gallery') { ?> <div class="content-article"> <?php echo $filtered_content; ?> </div> <?php } ?> </div> <?php if (etheme_get_option('blog_byline') && etheme_get_option('blog_layout') == 'timeline') { ?> <div class="meta-post-timeline"> <?php the_time(get_option('date_format')); ?> / <?php the_time(get_option('time_format')); ?> </div> <?php } ?> </article>
?> </a> <?php } ?> </div> <?php } ?> </div> </div> </div> </div> <!-- page wrapper --> <?php if (etheme_get_option('to_top')) { ?> <div class="back-to-top hidden-phone hidden-tablet"> <span><?php _e('Back to top', ETHEME_DOMAIN); ?> </span> </div> <?php } ?> <?php do_action('after_page_wrapper'); ?>
</div> <?php } ?> <?php /** * woocommerce_after_shop_loop_item_title hook * * @hooked woocommerce_template_loop_rating - 5 * @hooked woocommerce_template_loop_price - 10 */ if (etheme_get_option('product_page_price')) { do_action('woocommerce_after_shop_loop_item_title'); } ?> <div class="product-excerpt"> <?php echo do_shortcode(get_the_excerpt()); ?> </div> <?php if (etheme_get_option('product_page_addtocart')) { do_action('woocommerce_after_shop_loop_item'); } ?> </div> </div> </div>
<?php } else { ?> <h3><?php _e('No pages were found!', ETHEME_DOMAIN); ?> </h3> <?php } ?> <div class="clear"></div> <?php if (etheme_get_option('recent_projects')) { echo etheme_get_recent_portfolio(8, __('Recent Works', ETHEME_DOMAIN), $post->ID); } if (etheme_get_option('portfolio_comments')) { comments_template('', true); } ?> </div> </div> </div> </div> <?php get_footer();
<div class="portfolio-descr"> <h3><?php the_title(); ?> <h3> <?php if (has_post_thumbnail($postId)) { ?> <?php $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?> <?php if (etheme_get_option('port_use_lightbox')) { ?> <a class="button small btn-icon btn-enlarge" rel="lightbox[portfolio]" href="<?php echo $url; ?> "><i class="icon-fullscreen"></i></a><?php } ?> <?php } ?> <a class="button small active btn-icon btn-link" href="<?php the_permalink($postId); ?> "><i class="icon-link"></i></a>
</span> <?php } ?> <?php if (etheme_get_option('project_name')) { ?> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php } ?> <?php if (etheme_get_option('project_excerpt')) { ?> <?php the_excerpt(); ?> <?php } ?> </div> </div>
?> <div id="back-to-top" class="btn-style-<?php etheme_option('to_top'); ?> "><a href="#top" id="top-link" ><span><?php _e('Back to top', ETHEME_DOMAIN); ?> </span></a></div> <?php } ?> </div> </div> <?php if (etheme_get_option('responsive')) { ?> <div class="span12 responsive-switcher visible-phone visible-tablet <?php if (!$etheme_responsive) { echo 'visible-desktop'; } ?> "> <?php _e('Mobile version', ETHEME_DOMAIN); ?> : <?php if ($etheme_responsive) { ?> <a href="<?php
<?php if (etheme_get_option('top_bar')) { ?> <div class="top-bar"> <div class="container"> <div class="languages-area"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('languages-sidebar')) { ?> <div class="languages"> <ul class="links"> <li class="active">EN</li> <li><a href="#">FR</a></li> <li><a href="#">DE</a></li> </ul> </div> <div class="currency"> <ul class="links"> <li><a href="#">£</a></li> <li><a href="#">€</a></li> <li class='active'>$</li> </ul> </div> <?php } ?> </div>
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; }
function etheme_create_portfolio_slider($args, $title = false, $enable_slider_from = 4, $last_offset = 3) { global $wpdb; $portfolio_columns = etheme_get_option('portfolio_columns'); $box_id = rand(1000, 10000); $multislides = new WP_Query($args); ob_start(); if ($multislides->have_posts()) { if ($title) { $title_output = '<h4 class="slider-title">' . $title . '</h4>'; } echo '<div class="product-slider works-slider columns' . $portfolio_columns . '">'; echo $title_output; echo '<div class="clear"></div>'; echo '<div class="carousel slider-' . $box_id . '">'; echo '<div class="slider">'; $_i = 0; while ($multislides->have_posts()) { $multislides->the_post(); $_i++; echo '<div class="slide span3 portfolio-slide">'; get_template_part('portfolio', 'slide'); echo '</div><!-- slide -->'; } echo '</div><!-- slider -->'; echo '</div><!-- carousel -->'; if ($_i > $enable_slider_from) { echo '<div class="prev arrow' . $box_id . '" style="cursor: pointer; "> </div>'; echo '<div class="next arrow' . $box_id . '" style="cursor: pointer; "> </div>'; } echo '</div><!-- product-slider -->'; } wp_reset_query(); if ($_i > $enable_slider_from) { echo ' <script type="text/javascript"> jQuery(document).ready(function(){ jQuery(".arrow' . $box_id . '.prev").addClass("disabled"); jQuery(".slider-' . $box_id . '").iosSlider({ desktopClickDrag: true, snapToChildren: true, infiniteSlider: false, navNextSelector: ".arrow' . $box_id . '.next", navPrevSelector: ".arrow' . $box_id . '.prev", lastSlideOffset: ' . $last_offset . ', 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> '; } $html = ob_get_contents(); ob_end_clean(); return $html; }
do_action('woocommerce_before_add_to_cart_button'); ?> <?php if (!$product->is_sold_individually()) { woocommerce_quantity_input(array('min_value' => apply_filters('woocommerce_quantity_input_min', 1, $product), 'max_value' => apply_filters('woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product))); } ?> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr($product->id); ?> " /> <button type="submit" class="<?php if (etheme_get_option('ajax_addtocart')) { ?> etheme-simple-product<?php } ?> filled big font2 single_add_to_cart_button button big alt"><?php echo $product->single_add_to_cart_text(); ?> </button> <?php etheme_wishlist_btn(); ?> <?php do_action('woocommerce_after_add_to_cart_button');
<?php /** * Single Product Up-Sells * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $product, $woocommerce, $woocommerce_loop; $upsells = $product->get_upsells(); if (sizeof($upsells) == 0) { return; } $meta_query = $woocommerce->query->get_meta_query(); $args = array('post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => $posts_per_page, 'orderby' => $orderby, 'post__in' => $upsells, 'post__not_in' => array($product->id), 'meta_query' => $meta_query); $sidebar_slider = false; if (etheme_get_option('upsell_location') == 'sidebar') { etheme_create_flex_slider($args, __('Our offers', ETHEME_DOMAIN), false, true); } else { $slider_args = array('title' => __('Our offers', ETHEME_DOMAIN)); etheme_create_slider($args, $slider_args); } wp_reset_postdata();
<?php } ?> <div id="default_products_page_container" class="<?php if (!$product_sidebar) { echo 'no-sidebar'; } else { echo 'with-sidebar'; } ?> "> <?php global $wp_query; $cat = $wp_query->get_queried_object(); if (!$cat->term_id) { $image = etheme_get_option('product_bage_banner'); } else { $thumbnail_id = get_woocommerce_term_meta($cat->term_id, 'thumbnail_id', true); $image = wp_get_attachment_url($thumbnail_id); } if ($image && $image != '') { ?> <img class="cat-banner" src="<?php echo $image; ?> " /> <?php } ?> <?php do_action('woocommerce_archive_description'); ?>
echo do_shortcode(etheme_get_custom_field('_etheme_custom_tab2')); ?> </div> <?php } ?> <?php if (etheme_get_option('custom_tab_title') && etheme_get_option('custom_tab_title') != '') { ?> <a href="#tab9" id="tab_9" class="tab-title"><?php etheme_option('custom_tab_title'); ?> </a> <div id="content_tab_9" class="tab-content"> <?php echo do_shortcode(etheme_get_option('custom_tab')); ?> </div> <?php } ?> </div> </div> </div> <?php }
<?php /** * Loop Add to Cart * * @author WooThemes * @package WooCommerce/Templates * @version 2.1.0 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $product; $class = ''; if (etheme_get_option('ajax_addtocart') && $product->is_purchasable()) { $class .= 'etheme_add_to_cart_button '; } echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s">%s</a>', esc_url($product->add_to_cart_url()), esc_attr($product->id), esc_attr($product->get_sku()), $class, esc_attr($product->product_type), esc_html($product->add_to_cart_text())), $product);