示例#1
0
文件: woo.php 项目: sniezekjp/prod-fs
 /**
  * 
  *  Add theme support
  */
 function init()
 {
     // Add woocommerce support
     add_action('after_setup_theme', array($this, 'support'));
     // Register my own styles, remove woocommerce stylesheet
     if (twoot_get_checked_func('woocommerce_version', '2.1')) {
         add_filter('woocommerce_enqueue_styles', '__return_false');
     } else {
         define('WOOCOMMERCE_USE_CSS', false);
     }
     // Ajax Mini Cart
     add_filter('add_to_cart_fragments', array($this, 'mini_cart_fragment'));
     // Responsive Ajax Mini Cart
     add_filter('add_to_cart_fragments', array($this, 'responsive_mini_cart_fragment'));
     // Widget Ajax Cart
     add_filter('add_to_cart_fragments', array($this, 'widget_cart_fragment'));
     // Hooks
     $this->hooks();
     // Widgets
     add_action('widgets_init', array($this, 'widgets'));
     // Scripts
     add_action('wp_enqueue_scripts', array($this, 'scripts'), 30);
 }
示例#2
0
 /**
  * Notices
  *
  * @since   1.0.0
  */
 public function notices()
 {
     global $wp_version;
     $messages = array();
     if (!is_writeable(TWOOT_CACHE)) {
         $messages[] = 'The cache folder (' . str_replace(WP_CONTENT_DIR, '', TWOOT_CACHE) . ') is not writeable, please set the permission for this folder to 777.';
     }
     if (is_multisite()) {
         global $blog_id;
         if (!is_writeable(TWOOT_CACHE . DIRECTORY_SEPARATOR . 'custom-' . $blog_id . '.css')) {
             $messages[] = 'The skin style file (' . str_replace(WP_CONTENT_DIR, '', TWOOT_CACHE) . '/custom-' . $blog_id . '.css' . ') is not writeable, please set the permission for this file to 777.';
         }
     } else {
         if (!is_writeable(TWOOT_CACHE . DIRECTORY_SEPARATOR . 'custom.css')) {
             $messages[] = 'The skin style file (' . str_replace(WP_CONTENT_DIR, '', TWOOT_CACHE) . '/custom.css' . ') is not writeable, please set the permission for this file to 777.';
         }
     }
     if (!twoot_get_checked_func('wp_version')) {
         $messages[] = 'The current wordpress version(' . $wp_version . ') is too low. Please upgrade to 3.5 or above.';
     }
     if (!twoot_get_checked_func('toolkit_activated')) {
         $messages[] = 'You have not installed the plugin: ThemeWoot Toolkit, please install the plugin to get more features.';
     }
     if (twoot_get_checked_func('theme_setup') && isset($_GET['activated'])) {
         $messages[] = 'The ' . get_option('current_theme') . ' theme was successfully activated.';
     }
     if (twoot_get_checked_func('plugin_version') && twoot_get_checked_func('toolkit_activated')) {
         $messages[] = 'The current twoot toolkit plugin version(' . get_option(TWOOT_PREFIX . 'toolkit_version') . ') is too low. Please upgrade to ' . TWOOT_PLUGIN_VERSION . '.';
     }
     if (!empty($messages)) {
         $html = '<ul>';
         foreach ($messages as $message) {
             $html .= '<li>' . $message . '</li>';
         }
         $html .= '</ul>';
         echo '<div id="theme-warning" class="error fade"><p><strong>' . sprintf(esc_attr__('%1$s Messages', 'Twoot'), TWOOT_NAME) . '</strong><br/>' . $html . '</p></div>';
     }
 }
示例#3
0
/**
* Extends the default WordPress body class
*
* @since   1.0.0
*/
function twoot_body_class($classes)
{
    global $is_IE, $is_opera, $is_safari, $is_chrome;
    $layout = twoot_get_frontend_func('opt', 'opt', 'layout');
    if ($is_opera) {
        $classes[] = 'opera';
    } elseif ($is_safari) {
        $classes[] = 'safari';
    } elseif ($is_chrome) {
        $classes[] = 'chrome';
    } elseif ($is_IE) {
        $classes[] = 'ie';
        if (preg_match('/MSIE ([0-9]+)([a-zA-Z0-9.]+)/', $_SERVER['HTTP_USER_AGENT'], $browser_version) && $browser_version[1] == '8') {
            $classes[] = 'ie8';
        }
    }
    if ($layout) {
        $classes[] = $layout;
    }
    if (twoot_get_checked_func('woo_activated')) {
        $classes[] = 'woo';
    }
    if (twoot_get_checked_func('wpml_activated')) {
        $classes[] = 'wpml';
    }
    if (is_page()) {
        $classes[] = twoot_get_frontend_func('meta', 'layout') == 'full' ? 'has-not-sidebar' : 'has-sidebar';
    }
    return $classes;
}
示例#4
0
/assets/images/girls-elite-youth.png" alt="Girls Elite Youth Basketball">
			</div>
		</div>
	</div>
	</section>
</header>
<!--end #logo-->

<header class="site-menu">
	<section class="container">
	<div class="inner non-responsive clearfix">
	<?php 
echo twoot_generator('menu');
?>
	<?php 
if (twoot_get_checked_func('woo_activated')) {
    echo twoot_woo_generator('mini_cart');
}
?>
	</div>
	<?php 
echo twoot_generator('responsive_menu');
?>
	</section>
</header>
<!--end #menu-->

</div>
<!--end #header-->
<div class="clear"></div>
示例#5
0
<?php

/**
 * Template Name: Portfolio
 * @package WordPress
 * @subpackage ThemeWoot
 * @author ThemeWoot Team
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!twoot_get_checked_func('toolkit_activated')) {
    wp_die(esc_attr__('You have not installed the plugin: Twoot Toolkit, please install the plugin first.', 'Twoot'));
}
$layout = twoot_get_frontend_func('meta', 'layout') == false ? 'full' : twoot_get_frontend_func('meta', 'layout');
$widget = twoot_get_frontend_func('meta', 'sidebar') == false ? 'portfolio' : twoot_get_frontend_func('meta', 'sidebar');
get_header();
?>

<div id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
<div class="site-content container pt pb clearfix">

<?php 
示例#6
0
 /**
  * Left Grid
  * @since     1.0
  * @updated   1.0
  *
  */
 public function left_grid()
 {
     extract($this->atts);
     // Loop
     switch ($post_type) {
         case 'portfolio':
             $loop = 'portfolio';
             break;
         case 'post':
             $loop = 'blog';
             break;
         case 'product':
             $loop = 'product';
             break;
     }
     // Check if the woo has actived
     if (!twoot_get_checked_func('woo_activated') && $post_type == 'product') {
         return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please make sure that you have installed the plugin:woocommerce.', 'Twoot') . '</div>';
     }
     // ul & li class
     $ul_class = $post_type == 'product' ? ' products outer' : '';
     $li_class = $post_type == 'product' ? 'item product-item' : 'item';
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => $post_type, 'taxonomy' => $taxonomy));
     $do_query = is_page() || is_singular() ? new WP_Query($query->do_template_query()) : new WP_Query($query->do_global_query());
     $this->entries = $do_query;
     // Check if it has posts
     if (empty($this->entries) || empty($this->entries->posts)) {
         return $html = '<div class="the-not-posts">' . esc_attr__('Sorry, there is no posts in the current categories, please add some items in the dashboard!', 'Twoot') . '</div>';
     }
     // Check if it's 4 columns
     if ($columns == 4) {
         return $html = '<div class="the-not-posts">' . esc_attr__('Sorry, the left grid layout do not support the 4 columns.', 'Twoot') . '</div>';
     }
     // Set the columns
     switch ($columns) {
         case 2:
             $grid = 'six';
             break;
         case 3:
             $grid = 'four';
             break;
     }
     // Output HTML
     $html = '<div class="the-grid-list left-grid outer clearfix">';
     $html .= '<div class="column three">' . $this->filter_terms_menu($this->entries->posts, $this->atts) . '</div>';
     $html .= '<div class="column nine">';
     $html .= '<ul class="filter-items clearfix' . $ul_class . '">';
     while ($this->entries->have_posts()) {
         $this->entries->the_post();
         //Get terms class
         $terms_class = $this->filter_terms_class(get_the_ID(), $this->atts);
         $html .= '<li class="' . $li_class . ' column ' . $grid . ' ' . $terms_class . '">';
         $html .= '<div class="inner">';
         $html .= twoot_generator('load_template', 'loop-' . $loop . '-grid');
         $html .= '</div>';
         $html .= '</li>';
     }
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     wp_reset_query();
     $html .= $paging == 'yes' ? twoot_generator('pagination', $this->entries) : '';
     return $html;
 }
 function responsive_menu()
 {
     $html = '<nav class="responsive-menu-wrap hide">';
     $html .= '<div class="responsive-menu-switch-wrap clearfix">';
     $html .= '<a href="#" class="responsive-menu-switch twoot-icon open" id="toggle-top-responsive-menu"></a>';
     if (twoot_get_checked_func('woo_activated')) {
         $html .= twoot_woo_generator('responsive_mini_cart');
     }
     $html .= '</div>';
     $html .= '<div class="responsive-menu top-responsive-menu hide">';
     $html .= '<ul>';
     if (has_nav_menu('top_menu')) {
         $args = array('container' => '', 'items_wrap' => '%3$s', 'depth' => 0, 'echo' => false, 'theme_location' => 'top_menu');
         $html .= wp_nav_menu($args);
     } else {
         $args = array('title_li' => 0, 'depth' => 0, 'echo' => false, 'sort_column' => 'menu_order');
         $html .= wp_list_pages($args);
     }
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</nav>';
     return $html;
 }