Пример #1
0
$layout = Everything::to_('footer/layout')->option();
if (!$layout->value) {
    return;
}
?>

<div id="footer">

	<div class="container">

		<section class="section">

			<div class="columns alt-mobile">
				<ul>
					<?php 
foreach (Everything::stringToColumns($layout->value) as $i => $column) {
    ?>
						<li class="<?php 
    echo $column['class'];
    ?>
">
							<?php 
    dynamic_sidebar(apply_filters('everything_sidebar', "footer-{$layout->name}-{$i}", 'footer'));
    ?>
						</li>
					<?php 
}
?>
				</ul>
			</div><!-- // .columns -->
Пример #2
0
 /**
  * Widgets initialization
  *
  * @since 1.0
  * @see \Drone\Theme::onWidgetsInit()
  */
 public function onWidgetsInit()
 {
     // Built-in sidebars
     foreach (Everything::to_('sidebar/list/builtin')->childs() as $id => $sidebar) {
         register_sidebar(array('id' => $id, 'name' => $sidebar->label, 'before_widget' => '<section id="%1$s" class="section widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>'));
     }
     // Additional sidebars
     foreach (Everything::to('sidebar/list/additional') as $id => $sidebar) {
         register_sidebar(array('id' => $id, 'name' => $sidebar['id'], 'before_widget' => '<section id="%1$s" class="section widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>'));
     }
     // Footer sidebars
     if (is_admin()) {
         $tags = \Drone\Options\Option\ConditionalTags::getTagsList();
     }
     foreach (Everything::to('footer/layout') as $tag => $layout) {
         for ($i = 0; $i < count(Everything::stringToColumns($layout)); $i++) {
             if ($tag == 'default') {
                 $name = sprintf(__('Footer column %d', 'everything'), $i + 1);
             } else {
                 $name = sprintf(__('(%1$s) Footer column %2$d', 'everything'), isset($tags[$tag]) ? $tags[$tag]['caption'] : '~' . $tag, $i + 1);
             }
             register_sidebar(array('name' => $name, 'id' => "footer-{$tag}-{$i}", 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>'));
         }
     }
     // Widgets
     $this->addThemeFeature('widget-unwrapped-text');
     $this->addThemeFeature('widget-page');
     $this->addThemeFeature('widget-posts-list');
     $this->addThemeFeature('widget-twitter');
     $this->addThemeFeature('widget-flickr');
     $this->addThemeFeature('widget-facebook-like-box');
     // WooCommerce
     if (Everything::isPluginActive('woocommerce')) {
         require $this->template_dir . '/inc/woocommerce-widgets.php';
         foreach (array('WC_Widget_Best_Sellers', 'WC_Widget_Cart', 'WC_Widget_Featured_Products', 'WC_Widget_Layered_Nav_Filters', 'WC_Widget_Layered_Nav', 'WC_Widget_Onsale', 'WC_Widget_Price_Filter', 'WC_Widget_Product_Categories', 'WC_Widget_Product_Search', 'WC_Widget_Product_Tag_Cloud', 'WC_Widget_Products', 'WC_Widget_Random_Products', 'WC_Widget_Recent_Products', 'WC_Widget_Recent_Reviews', 'WC_Widget_Recently_Viewed', 'WC_Widget_Top_Rated_Products') as $class) {
             if (class_exists($class)) {
                 unregister_widget($class);
                 register_widget('Everything_' . $class);
             }
         }
     }
     // WooCommerce Brands
     if (Everything::isPluginActive('woocommerce-brands')) {
         require $this->template_dir . '/inc/woocommerce-brands-widgets.php';
         foreach (array('WC_Widget_Brand_Nav') as $class) {
             if (class_exists($class)) {
                 unregister_widget($class);
                 register_widget('Everything_' . $class);
             }
         }
     }
 }
Пример #3
0
<?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">