function etheme_add_upload_product_setting($page_id, $id, $title = '') { $title = $title ? $title : __('Upload Image', ETHEME_DOMAIN); $output = ''; $formid = $id; $saved_file = etheme_get_custom_field('_' . $id); $uploadclass = $saved_file ? 'has-file' : ''; $output .= '<h4 class="upload_title">' . $title . '</h4>'; $output .= '<input type="text" name="etheme_product[_' . $id . ']" id="' . $id . '" value="' . $saved_file . '" class="upload ' . $uploadclass . '" />'; $output .= '<input id="' . $id . '" class="upload_button button button-highlighted " type="button" value="Upload" rel="' . $page_id . '" />'; $output .= '<div class="screenshot etheme clear" id="' . $id . '">'; if ($saved_file != '') { $remove = '<a href="#" class="remove etheme">Remove</a>'; $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $saved_file); if ($image) { $output .= '<img src="' . $saved_file . '" alt="" />' . $remove . ''; } else { $parts = explode("/", $saved_file); for ($i = 0; $i < sizeof($parts); ++$i) { $title = $parts[$i]; } $output .= '<div class="no_image"><a href="' . $saved_file . '">' . $title . '</a>' . $remove . '</div>'; } } $output .= '</div>'; return $output; }
* @version 1.6.4 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly global $post; if (!$post->post_excerpt) { return; } ?> <?php echo apply_filters('woocommerce_short_description', $post->post_excerpt); ?> <?php if (etheme_get_custom_field('_etheme_size_guide')) { ?> <div class="size_guide"> <a rel="lightbox" href="<?php etheme_option('size_guide_img'); ?> "><?php _e('SIZING GUIDE', ETHEME_DOMAIN); ?> </a> </div> <div class="size_guide sg_mobile"> <a rel="lightbox" href="<?php etheme_option('size_guide_img_mobile'); ?> "><?php
function etheme_custom_field($field) { echo etheme_get_custom_field($field); }
function et_size_guide() { if (etheme_get_custom_field('size_guide_img')) { ?> <?php $lightbox_rel = get_option('woocommerce_enable_lightbox') == 'yes' ? 'prettyPhoto' : 'lightbox'; ?> <div class="size_guide"> <a rel="<?php echo $lightbox_rel; ?> " href="<?php etheme_custom_field('size_guide_img'); ?> "><?php _e('SIZING GUIDE', ETHEME_DOMAIN); ?> </a> </div> <?php } }
<?php if (etheme_get_custom_field('copyright_url') != '') { ?> </a><?php } ?> </td> </tr> <?php } ?> </table> <?php if (etheme_get_custom_field('project_url') != '') { ?> <a href="<?php etheme_custom_field('project_url'); ?> " target="_blank" class="button fl-r active big arrow-right"><span><?php _e('Visit Project Site', ETHEME_DOMAIN); ?> </span></a> <?php } ?> <div class="clear"></div>
function etheme_get_page_sidebar($blog = false) { $result = array('position' => '', 'responsive' => '', 'sidebarname' => ''); $result['responsive'] = etheme_get_option('blog_sidebar_responsive'); $result['position'] = etheme_get_option('blog_sidebar'); $page_sidebar_state = etheme_get_custom_field('sidebar_state', $blog); $widgetarea = etheme_get_custom_field('widget_area', $blog); if ($widgetarea != '') { $result['sidebarname'] = 'custom'; } if ($page_sidebar_state != '') { $result['position'] = $page_sidebar_state; } if ($result['position'] == 'no_sidebar') { $result['position'] = false; } return $result; }
</div> <?php } ?> <?php if (etheme_get_custom_field('_etheme_custom_tab2_title') && etheme_get_custom_field('_etheme_custom_tab2_title') != '') { ?> <a href="#tab8" id="tab_8" class="tab-title"><?php etheme_custom_field('_etheme_custom_tab2_title'); ?> </a> <div id="content_tab_8" class="tab-content"> <?php 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 /** * The Sidebar containing the primary and secondary widget areas. * */ $page_sidebar = etheme_get_custom_field('widget_area'); ?> <div id="primary" class="widget-area" role="complementary"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) { dynamic_sidebar($page_sidebar); } else { /* No widget */ } ?> </div><!-- #primary .widget-area -->
?> </div> <?php } ?> </div> <?php if (etheme_get_option('upsell_location') == 'after_content') { woocommerce_upsell_display(); } ?> <?php if (etheme_get_custom_field('additional_block') != '') { echo '<div class="product-extra-content">'; et_show_block(etheme_get_custom_field('additional_block')); echo '</div>'; } ?> <?php if (etheme_get_option('show_related')) { woocommerce_output_related_products(); } ?> <meta itemprop="url" content="<?php the_permalink(); ?> " />
<?php global $etheme_responsive; $fd = etheme_get_option('footer_demo'); $fbg = etheme_get_option('footer_bg'); $fcolor = etheme_get_option('footer_text_color'); $ft = ''; $ft = apply_filters('custom_footer_filter', $ft); $custom_footer = etheme_get_custom_field('custom_footer', et_get_page_id()); ?> <?php if ($custom_footer != 'without') { ?> <?php if ((is_active_sidebar('footer1') || $fd) && empty($custom_footer)) { ?> <div class="footer-top footer-top-<?php echo esc_attr($ft); ?> "> <div class="container"> <?php if (!is_active_sidebar('footer1')) { ?> <?php if ($fd) { etheme_footer_demo('footer1'); } ?> <?php
<?php call_user_func($tab['callback'], $key, $tab); ?> </div> </div> <?php } ?> <?php if (etheme_get_custom_field('custom_tab1_title') && etheme_get_custom_field('custom_tab1_title') != '') { ?> <div id="content_tab_7" class="tab-content"> <div class="tab-content-inner"> <?php echo do_shortcode(etheme_get_custom_field('custom_tab1')); ?> </div> </div> <?php } ?> <?php if (etheme_get_option('custom_tab_title') && etheme_get_option('custom_tab_title') != '') { ?> <div id="content_tab_9" class="tab-content"> <div class="tab-content-inner"> <?php echo do_shortcode(etheme_get_option('custom_tab'));
previous_post_link('%link', '<span class="meta-nav">' . _x('', 'Previous post link', ETHEME_DOMAIN) . '</span> %title'); ?> </div> <div class="nav-next"><?php next_post_link('%link', '%title <span class="meta-nav">' . _x('', 'Next post link', ETHEME_DOMAIN) . '</span>'); ?> </div> </div><!-- #nav-above --> <div class="clear"></div> <?php } ?> <?php $blog_layout = etheme_get_option('blog_layout'); if (etheme_get_custom_field('post_layout') && etheme_get_custom_field('post_layout') != 'global') { $blog_layout = etheme_get_custom_field('post_layout'); } $blog_slider = etheme_get_option('post_img_slider'); switch ($blog_layout) { case 'default': $imH = 870; $imW = 870; break; case 'portrait': $imH = 340; $imW = 260; break; case 'horizontal': $imH = 300; $imW = 300; break;
etheme_option('custom_tab'); ?> </div> <?php } ?> <?php if (etheme_get_custom_field('_etheme_custom_tab1')) { ?> <div class="panel entry-content" id="custom2"> <?php etheme_custom_field('_etheme_custom_tab1'); ?> </div> <?php } ?> <?php if (etheme_get_custom_field('_etheme_custom_tab2')) { ?> <div class="panel entry-content" id="custom3"> <?php etheme_custom_field('_etheme_custom_tab2'); ?> </div> <?php } ?>
woocommerce_get_template('loop/sale-flash.php'); ?> <?php if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') { ?> <div class="img-wrapper"><img class="product_image img-hided" src="<?php echo etheme_get_custom_field('_etheme_hover'); ?> " alt="<?php the_title(); ?> "/></div><?php } ?> <div class="img-wrapper<?php if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') { echo ' hideableHover'; } ?> "><img class="product_image" src="<?php echo $url; ?> " alt="<?php the_title(); ?> "/></div> </a> <?php } else { echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />'; }
<?php $ht = $class = ''; $ht = apply_filters('custom_header_filter', $ht); $page_id = et_get_page_id(); $hstrucutre = etheme_get_header_structure($ht); $page_slider = etheme_get_custom_field('page_slider', $page_id); if (etheme_get_option('header_transparent')) { $class .= ' header-transparent'; } ?> <div class="header-wrapper header-type-<?php echo $ht . ' ' . $class; ?> "> <?php if (etheme_get_option('header_type') == 'vertical' || etheme_get_option('header_type') == 'vertical2') { ?> <div class="header-content nano-content"> <?php } ?> <?php get_template_part('headers/parts/top-bar', $hstrucutre); ?> <header class="header main-header"> <div class="header-top"> <div class="container">
function etheme_get_shop_sidebar() { $page_for_shop = woocommerce_get_page_id('shop'); $result = array('position' => 'left', 'responsive' => '', 'product_per_row' => 3, 'product_page_sidebar' => true, 'sidebar_hidden' => false, 'sidebar_width' => 3, 'sidebar_span' => 'col-md-3', 'content_span' => 'col-md-9'); $result['responsive'] = etheme_get_option('blog_sidebar_responsive'); $result['position'] = etheme_get_option('grid_sidebar'); $result['product_per_row'] = etheme_get_option('prodcuts_per_row'); $result['sidebar_hidden'] = etheme_get_option('sidebar_hidden'); $result['page_slider'] = etheme_get_custom_field('page_slider', $page_for_shop); $result['page_heading'] = etheme_get_custom_field('page_heading', $page_for_shop); $page_sidebar_state = etheme_get_custom_field('sidebar_state', $page_for_shop); $sidebar_width = etheme_get_custom_field('sidebar_width', $page_for_shop); $content_width = 12 - $result['sidebar_width']; $result['sidebar_span'] = 'col-md-' . $result['sidebar_width']; $result['content_span'] = 'col-md-' . $content_width; if ($sidebar_width != '') { $content_width = 12 - $sidebar_width; $result['sidebar_span'] = 'col-md-' . $sidebar_width; $result['content_span'] = 'col-md-' . $content_width; } if ($page_sidebar_state != '') { $result['position'] = $page_sidebar_state; } if ($result['position'] == 'no_sidebar' || $result['position'] == 'without') { $result['position'] = 'without'; $result['content_span'] = 'col-md-12'; } if ($result['product_per_row'] == 2 && $result['position'] == 'without') { $result['position'] = 'left'; $result['content_span'] = 'col-md-9'; } if ($result['product_per_row'] == 6) { $result['position'] = 'without'; $result['content_span'] = 'col-md-12'; } return $result; }
$woocommerce_loop['loop']++; // Extra post classes $classes = ''; if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) { $classes .= 'first '; } if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) { $classes .= 'last '; } $classes .= 'col-lg-4 col-sm-4 col-xs-6 '; if (!class_exists('YITH_WCWL')) { $classes .= 'wishlist-disabled '; } $hoverUrl = ''; if ($hover == 'swap') { $hoverUrl = etheme_get_custom_field('hover_img'); $size = get_option('shop_catalog_image_size'); if ($hoverUrl != '') { $hoverImg = vt_resize(false, $hoverUrl, $size['width'], $size['height'], $size['crop']); } } ?> <div class="product <?php echo $classes; ?> "> <?php do_action('woocommerce_before_shop_loop_item'); ?>
?> <li><a href="#"><?php etheme_custom_field('_etheme_custom_tab1_title'); ?> </a> <section> <?php etheme_custom_field('_etheme_custom_tab1'); ?> </section> </li> <?php } ?> <?php if (etheme_get_custom_field('_etheme_custom_tab2') && etheme_get_custom_field('_etheme_custom_tab2_title')) { ?> <li><a href="#"><?php etheme_custom_field('_etheme_custom_tab2_title'); ?> </a> <section> <?php etheme_custom_field('_etheme_custom_tab2'); ?> </section> </li> <?php } ?>
function etheme_post_meta_box() { global $post; ?> <input type="hidden" name="etheme_post_meta_box_nonce" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="format-settings"> <div class="format-setting-label"> <h3 class="label">Post Layout</h3> </div> <div class="format-setting type-select no-desc"> <div class="format-setting-inner"> <label>Use Global<input type="checkbox" name="etheme_post[post_layout][global]" value="1" <?php if ('global' == etheme_get_custom_field('post_layout')) { echo 'checked="checked"'; } ?> data-related="option-post-layout" class="ios-switch option-tree-ui-checkbox use-global"><div class="switch"></div></label> </div> </div> </div> <div class="format-settings option-post-layout <?php if ('global' == etheme_get_custom_field('post_layout')) { echo 'option-disabled'; } ?> "> <div class="format-setting type-radio-image no-desc"> <div class="format-setting-inner"> <div class="option-tree-ui-radio-images"> <p style="display:none"> <input type="radio" name="etheme_post[post_layout][value]" id="blog_layout-0" value="default" <?php checked('default', etheme_get_custom_field('post_layout')); ?> class="option-tree-ui-radio option-tree-ui-images"> <label for="blog_layout-0">Default</label> </p> <img src="<?php echo get_template_directory_uri(); ?> /code/css/images/blog_1.jpg" alt="Default" title="Default" class="option-tree-ui-radio-image <?php if ('default' == etheme_get_custom_field('post_layout')) { echo 'option-tree-ui-radio-image-selected'; } ?> "> </div> <div class="option-tree-ui-radio-images"> <p style="display:none"> <input type="radio" name="etheme_post[post_layout][value]" id="blog_layout-1" value="portrait" <?php checked('portrait', etheme_get_custom_field('post_layout')); ?> class="option-tree-ui-radio option-tree-ui-images"> <label for="blog_layout-1">Portrait Images</label> </p> <img src="<?php echo get_template_directory_uri(); ?> /code/css/images/blog_2.jpg" alt="Portrait Images" title="Portrait Images" class="option-tree-ui-radio-image <?php if ('portrait' == etheme_get_custom_field('post_layout')) { echo 'option-tree-ui-radio-image-selected'; } ?> "> </div> <div class="option-tree-ui-radio-images"> <p style="display:none"> <input type="radio" name="etheme_post[post_layout][value]" id="blog_layout-2" value="horizontal" <?php checked('horizontal', etheme_get_custom_field('post_layout')); ?> class="option-tree-ui-radio option-tree-ui-images"> <label for="blog_layout-2">Portrait Images 2</label> </p> <img src="<?php echo get_template_directory_uri(); ?> /code/css/images/blog_3.jpg" alt="Portrait Images 2" title="Portrait Images 2" class="option-tree-ui-radio-image <?php if ('horizontal' == etheme_get_custom_field('post_layout')) { echo 'option-tree-ui-radio-image-selected'; } ?> "> </div> </div> </div> </div> <?php }
/** * The main template file. * * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists. * Learn more: http://codex.wordpress.org/Template_Hierarchy * */ extract(etheme_get_page_sidebar(true)); get_header(); ?> <div class="container <?php echo etheme_get_custom_field('widget_area'); ?> "> <div class="row"> <?php blog_breadcrumbs(); ?> <?php if ($position && $responsive == 'top') { ?> <div class="span3 sidebar_grid sidebar_<?php echo $position; ?> "> <?php get_sidebar($sidebarname);
function etheme_product_meta_box() { global $post; ?> <div class="etheme-metaboxes"> <input type="hidden" name="etheme_product_meta_box_nonce" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <p> <input type="checkbox" name="etheme_product[_etheme_size_guide]" id="etheme_product[_etheme_size_guide]" value="1" <?php checked(1, etheme_get_custom_field('_etheme_size_guide')); ?> /> <label for="etheme_product[_etheme_size_guide]"><?php _e("Enable Size Guide on this product", ETHEME_DOMAIN); ?> </label> </p> <p> <input type="checkbox" name="etheme_product[_etheme_special]" id="etheme_product[_etheme_special]" value="1" <?php checked(1, etheme_get_custom_field('_etheme_special')); ?> /> <label for="etheme_product[_etheme_special]"><?php _e("Mark this product as a SPECIAL one", ETHEME_DOMAIN); ?> </label> </p> <p> <input type="checkbox" name="etheme_product[_etheme_new_label]" id="etheme_product[_etheme_new_label]" value="1" <?php checked(1, etheme_get_custom_field('_etheme_new_label')); ?> /> <label for="etheme_product[_etheme_new_label]"><?php _e("Mark this product as a NEW one", ETHEME_DOMAIN); ?> </label> </p> <hr class="div" style="clear:both"/> <p><?php _e("Hover img", ETHEME_DOMAIN); ?> <br/><span class="description"><?php _e("png, jpg or gif file", ETHEME_DOMAIN); ?> </span></p> <?php echo etheme_add_upload_product_setting($post->ID, 'etheme_hover', __("Upload image: png, jpg or gif file", ETHEME_DOMAIN)); ?> <hr class="div" style="clear:both"/> <p> <?php _e("Tab 1 title:", ETHEME_DOMAIN); ?> <input type="text" class="text" name="etheme_product[_etheme_custom_tab1_title]" value="<?php etheme_custom_field('_etheme_custom_tab1_title'); ?> " /> </p> <p><?php _e("Enter custom content you would like output to the product custom tab:", ETHEME_DOMAIN); ?> <br /> <textarea name="etheme_product[_etheme_custom_tab1]" id="etheme_custom_tab1" cols="39" rows="5"><?php etheme_custom_field('_etheme_custom_tab1'); ?> </textarea><br /> <span class="description"><?php _e('<b>NOTE:</b> You can use any shortcode / HTML code.', ETHEME_DOMAIN); ?> </span></p> <hr /> <p> <?php _e("Tab 2 title:", ETHEME_DOMAIN); ?> <input type="text" class="text" name="etheme_product[_etheme_custom_tab2_title]" value="<?php etheme_custom_field('_etheme_custom_tab2_title'); ?> " /> </p> <p><?php _e("Enter custom content you would like output to the product custom tab (second):", ETHEME_DOMAIN); ?> <br /> <textarea name="etheme_product[_etheme_custom_tab2]" cols="39" rows="5"><?php etheme_custom_field('_etheme_custom_tab2'); ?> </textarea><br /> <span class="description"><?php _e('<b>NOTE:</b> You can use any shortcode / HTML code.', ETHEME_DOMAIN); ?> </span></p> </div> <?php }
function etheme_get_blog_sidebar() { $page_for_posts = get_option('page_for_posts'); $result = array('position' => '', 'responsive' => '', 'sidebarname' => '', 'sidebar_width' => 3, 'sidebar_span' => 'span4', 'content_span' => 'span8', 'blog_layout' => 'default'); $result['responsive'] = etheme_get_option('blog_sidebar_responsive'); $result['position'] = etheme_get_option('blog_sidebar'); $result['blog_layout'] = etheme_get_option('blog_layout'); $result['sidebar_width'] = etheme_get_option('blog_sidebar_width'); $result['page_slider'] = etheme_get_custom_field('page_slider', $page_for_posts); $result['page_heading'] = etheme_get_custom_field('page_heading', $page_for_posts); $page_sidebar_state = etheme_get_custom_field('sidebar_state', $page_for_posts); $sidebar_width = etheme_get_custom_field('sidebar_width', $page_for_posts); $content_width = 12 - $result['sidebar_width']; $result['sidebar_span'] = 'span' . $result['sidebar_width']; $result['content_span'] = 'span' . $content_width; if ($sidebar_width != '') { $content_width = 12 - $sidebar_width; $result['sidebar_span'] = 'span' . $sidebar_width; $result['content_span'] = 'span' . $content_width; } if ($page_sidebar_state != '') { $result['position'] = $page_sidebar_state; } if ($result['position'] == 'no_sidebar' || $result['blog_layout'] == 'grid') { $result['position'] = 'without'; $result['content_span'] = 'span12'; } return $result; }