function widget($args, $instance) { ob_start(); parent::widget($args, $instance); $output = ob_get_clean(); extract($args); if ($instance['show_cart_icon']) { $output = str_replace($before_title, $before_title . Everything::getShortcodeOutput('vector_icon', array('name' => Everything::to('woocommerce/cart/icon'), 'advanced_class' => 'icon-woocommerce-cart', 'advanced_style' => 'margin-right: 0.4em;')), $output); } echo $output; }
function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0) { // Figure $figure = \Drone\HTML::figure()->class('thumbnail featured full-width'); // Hyperlink $a = $figure->addNew('a')->attr(Everything::getImageAttrs('a', array('border' => false, 'hover' => Everything::to('woocommerce/shop/image_hover'), 'fancybox' => false)))->href(get_permalink()); // Image if (has_post_thumbnail()) { $a->add(get_the_post_thumbnail($GLOBALS['post']->ID, $size)); if (Everything::to('woocommerce/shop/image_hover') == 'image') { $attachment_ids = $GLOBALS['product']->get_gallery_attachment_ids(); if (isset($attachment_ids[0])) { $a->add(wp_get_attachment_image($attachment_ids[0], $size)); } } } elseif (woocommerce_placeholder_img_src()) { $a->add(woocommerce_placeholder_img($size)); } return $figure->html(); }
<?php } ?> <strong><?php comment_author(); ?> </strong> <?php if (Everything::to('site/comments/date_format')) { ?> , <time class="small" datetime="<?php printf('%sT%sZ', get_comment_date('Y-m-d'), get_comment_time('H:i')); ?> " itemprop="datePublished"> <?php switch (Everything::to('site/comments/date_format')) { case 'relative': printf(__('%s ago', 'everything'), human_time_diff(get_comment_time('U', true))); break; case 'absolute': printf(__('%1$s at %2$s', 'everything'), get_comment_date(), get_comment_time()); break; } ?> </time> <?php } ?> </p> <article class="text" itemprop="description"> <?php
Everything::navMenu('main-desktop'); ?> </nav> <?php } ?> <?php if (Everything::to_('header/style/settings')->value('centered')) { echo '</div>'; } ?> <span class="helper"> <?php echo Everything::woocommerceGetCartInfo('big', Everything::to('header/cart/visible', '__hidden', array())); ?> </span> </div> <div id="mobile-section"> <?php if (Everything::to_('header/main_menu/visible')->value('mobile')) { ?> <nav class="mobile-nav-menu main"> <?php Everything::navMenu('main-mobile'); ?> </nav>
<?php /** * @package WordPress * @subpackage Everything * @since 1.0 */ // Separator $separator = '›'; // is_rtl() ? '‹' : '›' // bbPress if (Everything::isPluginActive('bbpress') && Everything::to('bbpress/breadcrumbs') && is_bbpress()) { $breadcrumbs_html = bbp_get_breadcrumb(array('before' => '', 'after' => '', 'sep' => $separator, 'sep_before' => '', 'sep_after' => '', 'current_before' => '', 'current_after' => '')); } else { if (Everything::isPluginActive('woocommerce') && Everything::to('woocommerce/breadcrumbs') && (is_shop() || is_product_taxonomy() || is_product())) { // || is_cart() || is_checkout() || is_order_received_page() || is_account_page() $breadcrumbs_html = \Drone\Func::functionGetOutputBuffer('woocommerce_breadcrumb', array('delimiter' => $separator, 'wrap_before' => '', 'wrap_after' => '')); } else { if (Everything::isPluginActive('breadcrumb-navxt')) { $options = get_option('bcn_options'); $separator = $options['hseparator']; $breadcrumbs_html = bcn_display(true); } else { if (Everything::isPluginActive('breadcrumb-trail')) { $breadcrumbs_html = breadcrumb_trail(array('separator' => $separator, 'show_browse' => false, 'echo' => false)); } else { if (Everything::isPluginActive('wordpress-seo')) { $options = get_option('wpseo_internallinks'); $separator = $options['breadcrumbs-sep'] ? $options['breadcrumbs-sep'] : '»'; $breadcrumbs_html = yoast_breadcrumb('', '', false); } else {
$nav->addOption('boolean', 'in_same_cat', true, __('Navigation', 'everything'), '', array('caption' => __('Next & Previous buttons navigate in current category only', 'everything'))); // ----------------------------------------------------------------------------- // Sidebar $sidebar = $theme_options->addGroup('sidebar', __('Sidebars', 'everything')); $list = $sidebar->addGroup('list', __('Available sidebars', 'everything'), sprintf(__('Notice: sidebars on the left side of content are always %dpx wide.', 'everything'), Everything::DEFAULT_SIDEBAR_WIDTH) . '<br />' . __('Usable width is 50px smaller because of paddings.', 'everything')); $builtin = $list->addGroup('builtin'); $builtin->addOption('number', 'primary', Everything::DEFAULT_SIDEBAR_WIDTH, '1. ' . _x('Primary', 'sidebar', 'everything'), '', array('min' => 60, 'max' => 600, 'unit' => 'px')); $builtin->addOption('number', 'secondary', Everything::DEFAULT_SIDEBAR_WIDTH, '2. ' . _x('Secondary', 'sidebar', 'everything'), '', array('min' => 60, 'max' => 600, 'unit' => 'px')); $list->addOption('collection', 'additional', array('id' => __('New sidebar', 'everything'), 'width' => Everything::DEFAULT_SIDEBAR_WIDTH), '', '', array('type' => 'sidebar', 'unique_index' => true, 'index_prefix' => 'additional-', 'on_html' => function ($option, &$html) { $html->child(0)->start = 3; })); $sidebar_options = array('' => __('(None)', 'everything')) + apply_filters('everything_sidebars', array_map(function ($sidebar) { return preg_replace('/^[0-9]\\. /', '', $sidebar->label); }, Everything::to_('sidebar/list/builtin')->childs()) + array_map(function ($sidebar) { return $sidebar['id']; }, Everything::to('sidebar/list/additional'))); $sidebar->addOption('conditional_tags', 'layout', array('#', '', 'primary'), __('Layout', 'everything'), '', array('type' => 'layout', 'options' => $sidebar_options)); // ----------------------------------------------------------------------------- // Footer $footer = $theme_options->addGroup('footer', __('Footer', 'everything')); $custom_layouts = apply_filters('everything_footer_custom_layouts', array()); $footer->addOption('conditional_tags', 'layout', '14_14_14_14', __('Layout', 'everything'), __('You can specify footer content in Appearance / Widgets.', 'everything'), array('type' => 'select', 'options' => array('11' => __('Full width', 'everything'), '12_12' => __('Two columns', 'everything'), '13_13_13' => __('Three columns', 'everything'), '14_14_14_14' => __('Four columns', 'everything'), '15_15_15_15_15' => __('Five columns', 'everything'), '16_16_16_16_16_16' => __('Six columns', 'everything'), '14_34' => '25% + 75%', '34_14' => '75% + 25%', '14_14_12' => '25% + 25% + 50%', '12_14_14' => '50% + 25% + 25%', '14_12_14' => '25% + 50% + 25%', '' => __('Disabled', 'everything')) + $custom_layouts, 'groups' => array(__('Basic', 'everything') => array('11', '12_12', '13_13_13', '14_14_14_14', '15_15_15_15_15', '16_16_16_16_16_16'), __('Two columns', 'everything') => array('14_34', '34_14'), __('Three columns', 'everything') => array('14_14_12', '12_14_14', '14_12_14'), __('Other', 'everything') => array('') + array_keys($custom_layouts)))); $end_note = $footer->addGroup('end_note', __('End note', 'everything')); $visible = $end_note->addOption('boolean', 'visible', true, '', '', array('caption' => __('Show end note', 'everything'))); $left = $end_note->addOption('memo', 'left', sprintf(__('© Copyright %s', 'everything'), date('Y')) . "\n" . sprintf(__('%1$s by <a href="%3$s">%2$s</a>', 'everything'), get_bloginfo('name'), wp_get_current_user()->display_name, esc_url(home_url('/'))), __('Left', 'everything'), '', array('owner' => $visible, 'on_html' => function ($option, $html) { $html->style = 'height: 70px;'; })); $right = $end_note->addOption('memo', 'right', sprintf(__('powered by %s theme', 'everything'), '<a href="' . Everything::ENVATO_PROFILE_URL . '">Everything</a>'), __('Right', 'everything'), '', array('owner' => $visible, 'on_html' => function ($option, $html) { $html->style = 'height: 70px;'; })); // -----------------------------------------------------------------------------
<article id="post-<?php the_ID(); ?> " <?php post_class('post'); ?> ><?php $post_format = (string) get_post_format(); get_template_part('parts/post-thumbnail', Everything::getBlogStyle() == 'bricks' ? 'bricks' : $post_format); Everything::meta('before'); Everything::title(); if (is_search()) { the_excerpt(); } else { if (get_post_type() == 'post') { switch (Everything::to(array("format_posts/{$post_format}/content", 'format_posts/standard/content'))) { case 'excerpt': the_excerpt(); break; case 'excerpt_content': if (has_excerpt()) { the_excerpt(); break; } case 'content': the_content(Everything::getReadMore()); break; } } else { the_content(Everything::getReadMore()); }
* @package WordPress * @subpackage Everything * @since 1.0 */ ?> <?php if (have_posts()) { ?> <section class="section"> <div class="bricks alt-mobile" data-bricks-columns="<?php echo Everything::to('site/blog/columns'); ?> " data-bricks-filter="<?php echo \Drone\Func::boolToString($filter = Everything::to('site/blog/filter/filter', '__hidden')); ?> "> <?php while (have_posts()) { the_post(); ?> <?php if ($filter) { $terms = \Drone\Func::wpPostTermsList(get_the_ID(), $filter); if (is_category() && ($term_id = array_search(single_cat_title('', false), $terms)) !== false) { unset($terms[$term_id]); } $terms = esc_attr(json_encode(array_values($terms))); } ?>
* @since 1.0 * @version 1.6.4 */ // ----------------------------------------------------------------------------- if (!defined('ABSPATH')) { exit; } // ----------------------------------------------------------------------------- global $product, $woocommerce_loop; // Store loop count we're currently on if (empty($woocommerce_loop['loop'])) { $woocommerce_loop['loop'] = 0; } // Store column count for displaying the grid if (empty($woocommerce_loop['columns'])) { $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', Everything::to('woocommerce/shop/columns')); } // Ensure visibility if (!$product || !$product->is_visible()) { return; } // Increase loop count $woocommerce_loop['loop']++; ?> <li <?php post_class('col-1-' . $woocommerce_loop['columns']); ?> > <article class="product">
<?php /** * @package WordPress * @subpackage Everything * @since 1.0 */ ?> <?php if (has_post_thumbnail() && !post_password_required() && apply_filters('everything_post_thumbnail_display', Everything::to_('format_posts/image/thumbnail')->value(is_singular() ? 'single' : 'list'))) { ?> <figure class="thumbnail full-width"> <a href="<?php if (Everything::to('format_posts/image/link') == 'post' && !is_singular()) { the_permalink(); } else { list($src) = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); echo $src; } ?> " <?php Everything::imageAttrs('a'); ?> > <?php the_post_thumbnail('full-width'); ?> </a> </figure> <?php
protected function onSetupOptions(\Drone\Options\Group\Shortcode $options) { $options->addOption('select', 'index', '', __('Name', 'everything'), '', array('options' => function () { $options = array(); foreach (\Everything::to('font/custom') as $index => $custom_font) { $options[$index] = $custom_font['id']; } if (count($options) == 0) { $options[''] = '(' . __('No fonts defined in Theme Options / Fonts / Custom', 'everything') . ')'; } return $options; }, 'required' => false)); $advanced = $options->addGroup('advanced', __('Advanced', 'everything')); $advanced->addOption('text', 'tag', 'span', __('HTML tag', 'everything')); $advanced->addOption('text', 'class', '', __('CSS class', 'everything')); $advanced->addOption('text', 'style', '', __('CSS style', 'everything')); }
the_ID(); ?> " <?php post_class('post'); ?> ><?php get_template_part('parts/post-thumbnail', Everything::getBlogStyle() == 'bricks' ? 'bricks' : get_post_format()); Everything::meta('before'); ?> <h2 class="entry-title"> <?php Everything::title(); ?> </h2> <?php the_content(null, Everything::to('post/strip_teaser')); echo Everything::getPaginateLinks('page'); ?> </article> </section> <span class="vcard author post-author"><span class="fn"> <?php get_template_part('parts/author-bio'); ?> </span></span> <?php Everything::socialButtons(); ?> <?php Everything::meta(); ?>
<?php /** * @package WordPress * @subpackage Everything * @since 1.0 */ ?> <?php get_header(); ?> <section class="section"> <?php echo \Drone\Func::wpProcessContent(Everything::to('not_found/content')); ?> </section> <?php get_footer();
* @package WooCommerce/Templates * @subpackage Everything * @since 1.0 * @version 2.0.3 */ // ----------------------------------------------------------------------------- if (!defined('ABSPATH')) { exit; } // ----------------------------------------------------------------------------- global $post, $product, $woocommerce; $attachment_ids = $product->get_gallery_attachment_ids(); if (count($attachment_ids) == 0) { return; } $columns = apply_filters('woocommerce_product_thumbnails_columns', Everything::to('woocommerce/product/thumbnails_columns')); ?> <div class="columns"> <ul> <?php foreach ($attachment_ids as $attachment_id) { if (!($url = wp_get_attachment_url($attachment_id))) { continue; } ?> <li class="col-1-<?php echo $columns; ?> "> <figure class="full-width">
break; case 'excerpt_content': if (has_excerpt()) { the_excerpt(); break; } case 'content': the_content(Everything::getReadMore()); break; } ?> <?php if (Everything::to('portfolio/archive/taxonomy/visible')) { ?> <?php the_terms(get_the_ID(), 'portfolio-' . Everything::to('portfolio/archive/taxonomy/taxonomy'), '<p class="small alt">', ', ', '</p>'); ?> <?php } ?> </article> </div> <?php } ?> </div> <?php echo Everything::getPaginateLinks('portfolio'); ?> </section>
<?php /** * @package WordPress * @subpackage Everything * @since 1.0 */ get_header(); get_template_part('parts/blog', Everything::to('site/blog/style')); get_footer();
the_post(); ?> <section class="section"> <article id="post-<?php the_ID(); ?> " <?php post_class('post'); ?> > <?php Everything::title(); ?> <?php the_content(null, Everything::to('portfolio/strip_teaser')); ?> <?php echo Everything::getPaginateLinks('page'); ?> </article> </section> <?php get_template_part('parts/author-bio'); ?> <?php Everything::socialButtons(); ?> <?php Everything::meta();
<?php do_action('woocommerce_before_single_product'); ?> <div itemscope itemtype="http://schema.org/Product" id="product-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="columns"> <?php $columns = Everything::stringToColumns(Everything::to('woocommerce/product/image_size')); ?> <ul> <li class="<?php echo $columns[0]['class']; ?> "> <?php do_action('woocommerce_before_single_product_summary'); ?> </li> <li class="<?php echo $columns[1]['class']; ?> "> <div class="summary entry-summary">
* @package WordPress * @subpackage Everything * @since 1.0 */ switch (get_post_type()) { case 'portfolio': $taxonomy = 'portfolio-category'; break; case 'product': $taxonomy = 'product_cat'; break; default: $taxonomy = 'category'; } $prev_post = get_previous_post(Everything::to('nav/in_same_cat'), '', $taxonomy); $next_post = get_next_post(Everything::to('nav/in_same_cat'), '', $taxonomy); ?> <div class="nav"> <?php if ($prev_post) { ?> <a class="button small" href="<?php echo esc_url(get_permalink($prev_post)); ?> " title="<?php echo esc_attr($prev_post->post_title); ?> "> <i class="icon-left-open"></i><span><?php
/** * Get thumbnail caption for WooCommerce product image * * @since 1.0 * * @param int|object $thumbnail * @return string */ public static function woocommerceGetThumbnailCaption($thumbnail) { if (!Everything::to('woocommerce/product/captions')) { return ''; } if (!is_object($thumbnail)) { $thumbnail = get_post($thumbnail); } switch (Everything::to('woocommerce/product/captions')) { case 'title': return trim($thumbnail->post_title); case 'caption': return trim($thumbnail->post_excerpt); case 'caption_title': $caption = trim($thumbnail->post_excerpt) or $caption = trim($thumbnail->post_title); return $caption; } }
<?php /** * @package WordPress * @subpackage Everything * @since 1.0 */ if (!apply_filters('everything_comments_display', Everything::to(array(get_post_type() . '/comments', 'page/comments'))) && !post_password_required()) { return; } ?> <?php if (have_comments()) { ?> <section id="comments" class="section"> <ul class="comments"> <?php wp_list_comments(array('style' => 'div', 'callback' => function ($comment, $args, $depth) { $GLOBALS['comment'] = $comment; require get_template_directory() . '/comment.php'; }, 'end-callback' => function () { echo '</ul></li>'; })); ?> </ul> <?php echo Everything::getPaginateLinks('comments'); ?> </section>
exit; } // ----------------------------------------------------------------------------- if (!Everything::to('woocommerce/product/meta/visible') || count(Everything::to_('woocommerce/product/meta/items')->values()) == 0) { return; } global $post, $product; ?> <hr /> <p class="product_meta"> <?php do_action('woocommerce_product_meta_start'); foreach (Everything::to('woocommerce/product/meta/items') as $item) { switch ($item) { case 'sku': if ($product->is_type(array('simple', 'variable')) && get_option('woocommerce_enable_sku') == 'yes' && $product->get_sku()) { printf('<span itemprop="productID" class="sku_wrapper">%s <span class="sku">%s</span>.</span>', __('SKU:', 'woocommerce'), $product->get_sku()); } break; case 'categories': $size = sizeof(get_the_terms($post->ID, 'product_cat')); echo $product->get_categories(', ', '<span class="posted_in">' . _n('Category:', 'Categories:', $size, 'woocommerce') . ' ', '.</span>'); break; case 'tags': $size = sizeof(get_the_terms($post->ID, 'product_tag')); echo $product->get_tags(', ', '<span class="tagged_as">' . _n('Tag:', 'Tags:', $size, 'woocommerce') . ' ', '.</span>'); break; case 'brands':
<?php if (is_singular()) { ?> <div <?php Everything::imageAttrs('div'); ?> > <?php the_post_thumbnail('post-thumbnail', Everything::to('post/thumbnail/size')); ?> </div> <?php } else { ?> <a href="<?php the_permalink(); ?> " <?php Everything::imageAttrs('a'); ?> > <?php the_post_thumbnail('post-thumbnail', Everything::to('post/thumbnail/size')); ?> </a> <?php } ?> </figure> <?php }