本文整理汇总了PHP中is_woocommerce_activated函数的典型用法代码示例。如果您正苦于以下问题:PHP is_woocommerce_activated函数的具体用法?PHP is_woocommerce_activated怎么用?PHP is_woocommerce_activated使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_woocommerce_activated函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: woothemes_add_css
function woothemes_add_css()
{
global $woo_options;
wp_register_style('prettyPhoto', get_template_directory_uri() . '/includes/css/prettyPhoto.css');
wp_register_style('non-responsive', get_template_directory_uri() . '/css/non-responsive.css');
// Disable prettyPhoto css if WooCommerce is activated and user is on the product page
$woocommerce_activated = is_woocommerce_activated();
$woocommerce_lightbox = get_option('woocommerce_enable_lightbox') == 'yes' ? true : false;
$woocommerce_product = false;
if ($woocommerce_activated) {
$woocommerce_product = is_product();
}
if ($woocommerce_activated && $woocommerce_product && $woocommerce_lightbox) {
wp_deregister_style('prettyPhoto');
}
// Conditionally load the Portfolio CSS, where needed.
$load_portfolio_css = false;
if (is_page_template('template-portfolio.php') || is_singular() && get_post_type() == 'portfolio' || is_post_type_archive('portfolio') || is_tax('portfolio-gallery')) {
$load_portfolio_css = true;
}
// Allow child themes/plugins to load the portfolio CSS when they need it.
$load_portfolio_css = apply_filters('woo_load_portfolio_css', $load_portfolio_css);
if ($load_portfolio_css) {
wp_enqueue_style('prettyPhoto');
}
do_action('woothemes_add_css');
}
示例2: storefront_woocommerce_body_class
/**
* Add 'woocommerce-active' class to the body tag
* @param array $classes
* @return array $classes modified to include 'woocommerce-active' class
*/
function storefront_woocommerce_body_class($classes)
{
if (is_woocommerce_activated()) {
$classes[] = 'woocommerce-active';
}
return $classes;
}
示例3: woothemes_add_javascript
function woothemes_add_javascript()
{
global $woo_options;
wp_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array('jquery'));
wp_register_script('enable-lightbox', get_template_directory_uri() . '/includes/js/enable-lightbox.js', array('jquery', 'prettyPhoto'));
wp_register_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=false');
wp_register_script('google-maps-markers', get_template_directory_uri() . '/includes/js/markers.js');
wp_register_script('flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider-min.js', array('jquery'));
wp_register_script('featured-slider', get_template_directory_uri() . '/includes/js/featured-slider.js', array('jquery', 'flexslider'));
wp_register_script('infinite-scroll', get_template_directory_uri() . '/includes/js/jquery.infinitescroll.min.js', array('jquery'));
wp_register_script('masonry', get_template_directory_uri() . '/includes/js/jquery.masonry.min.js', array('jquery'));
wp_enqueue_script('third party', get_template_directory_uri() . '/includes/js/third-party.js', array('jquery'));
wp_enqueue_script('tiptip', get_template_directory_uri() . '/includes/js/jquery.tiptip.min.js', array('jquery'));
wp_enqueue_script('general', get_template_directory_uri() . '/includes/js/general.js', array('jquery'));
// Load Google Script on Contact Form Page Template
if (is_page_template('template-contact.php')) {
wp_enqueue_script('google-maps');
wp_enqueue_script('google-maps-markers');
}
// End If Statement
// Load infinite scroll on shop page / product cats
if (is_woocommerce_activated()) {
if ($woo_options['woocommerce_archives_infinite_scroll'] == 'true' && (is_shop() || is_product_category())) {
wp_enqueue_script('infinite-scroll');
}
}
// Load Masonry on the blog grid layout
if (is_page_template('template-blog-grid.php')) {
wp_enqueue_script('masonry');
add_action('wp_head', 'woo_fire_masonry');
}
do_action('woothemes_add_javascript');
}
示例4: storefront_header_cart
function storefront_header_cart()
{
if (is_woocommerce_activated()) {
if (is_cart()) {
$class = 'current-menu-item';
} else {
$class = '';
}
?>
<ul class="site-header-cart menu">
<li class="<?php
echo esc_attr($class);
?>
">
<?php
storefront_cart_link();
?>
</li>
<li>
<?php
the_widget('WC_Widget_Cart', 'title=');
?>
</li>
</ul>
<?php
}
}
示例5: eighteen_tags_woocommerce_body_class
/**
* Add 'woocommerce-active' class to the body tag
* @param array $classes
* @return array $classes modified to include 'woocommerce-active' class
*/
function eighteen_tags_woocommerce_body_class($classes)
{
if (is_woocommerce_activated()) {
$classes[] = 'woocommerce-active';
}
return $classes;
}
示例6: g_layout_adjustments
/**
* Layout adjustments
* @return rearrange markup through add_action and remove_action
*/
function g_layout_adjustments()
{
if (is_woocommerce_activated()) {
remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5);
remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
add_action('woocommerce_before_shop_loop_item_title', 'g_product_loop_title_price_wrap', 11);
add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 2);
add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 1);
add_action('woocommerce_after_shop_loop_item_title', 'g_product_loop_title_price_wrap_close', 2);
add_action('woocommerce_before_subcategory_title', 'g_product_loop_title_price_wrap', 11);
add_action('woocommerce_after_subcategory_title', 'g_product_loop_title_price_wrap_close', 2);
remove_action('storefront_header', 'storefront_header_cart', 60);
add_action('storefront_header', 'storefront_header_cart', 4);
remove_action('storefront_header', 'storefront_product_search', 40);
add_action('storefront_header', 'storefront_product_search', 3);
}
remove_action('storefront_header', 'storefront_secondary_navigation', 30);
add_action('storefront_header', 'storefront_secondary_navigation', 6);
remove_action('storefront_header', 'storefront_site_branding', 20);
add_action('storefront_header', 'storefront_site_branding', 5);
remove_action('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display');
add_action('woocommerce_after_cart', 'woocommerce_cross_sell_display', 30);
add_action('storefront_header', 'g_primary_navigation_wrapper', 49);
add_action('storefront_header', 'g_primary_navigation_wrapper_close', 61);
add_action('storefront_header', 'g_top_bar_wrapper', 1);
add_action('storefront_header', 'g_top_bar_wrapper_close', 6);
}
示例7: woocommerce_body_class
/**
* Add 'woocommerce-active' class to the body tag
* @param array $classes
* @return array $classes modified to include 'woocommerce-active' class
*/
public function woocommerce_body_class($classes)
{
if (is_woocommerce_activated()) {
$classes[] = 'woocommerce-active';
}
return $classes;
}
示例8: woa_remove_sidebar_shop_page
function woa_remove_sidebar_shop_page()
{
if (is_woocommerce_activated()) {
if (is_shop() || is_tax('product_cat') || get_post_type() == 'product') {
remove_action('storefront_sidebar', 'storefront_get_sidebar', 10);
add_filter('body_class', 'woa_remove_sidebar_class_body', 10);
}
}
}
示例9: calibrefx_initialize_other
function calibrefx_initialize_other()
{
if (is_woocommerce_activated()) {
// Support for Woocoomerce
add_theme_support('woocommerce');
remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
}
//remove unneccesary headers
remove_action('wp_head', 'wp_generator');
}
示例10: pbo_tools_initialize
/**
* Plugin initialization
*/
function pbo_tools_initialize()
{
load_plugin_textdomain('pbo-tools', false, dirname(plugin_basename(__FILE__)) . '/languages/');
require_once PBO_TOOLS_DIR . 'query-ex.php';
$SE = new SearchEverything();
if (is_woocommerce_activated()) {
require_once PBO_TOOLS_DIR . 'woocommerce/products.php';
require_once PBO_TOOLS_DIR . 'woocommerce/wc-product-ex.php';
}
}
示例11: odin_header_cart
/**
* Display Header Cart
*
* @since 2.2.6
*
* @uses is_woocommerce_activated() check if WooCommerce is activated
*/
function odin_header_cart()
{
if (is_woocommerce_activated()) {
?>
<ul class="site-header-cart menu">
<?php
odin_cart_link();
?>
<?php
the_widget('WC_Widget_Cart', 'title=');
?>
</ul>
<?php
}
}
示例12: converio_cart_shopping_bag
function converio_cart_shopping_bag()
{
if (is_woocommerce_activated()) {
?>
<div class="shopping-bag">
<?php
if (version_compare(WOOCOMMERCE_VERSION, "2.0.0") >= 0) {
the_widget('WC_Widget_Cart', 'title=');
} else {
the_widget('WooCommerce_Widget_Cart', 'title=');
}
?>
</div>
<?php
}
}
示例13: et_shop_on_sale_products
function et_shop_on_sale_products($args)
{
if (is_woocommerce_activated()) {
$on_sale_query = new WP_Query(array('post_type' => 'product', 'meta_query' => array(array('key' => '_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric'))));
if ($on_sale_query->have_posts()) {
?>
<section class="et_shop-product-section et_shop-on-sale-products">
<h2 class="section-title"><?php
echo wp_kses_post(__('On Sale', 'et_shop'));
?>
</h2>
<?php
echo et_shop_do_shortcode('sale_products', array('per_page' => 4, 'columns' => 4));
?>
</section><?php
}
}
}
示例14: __construct
/**
* Constructor function.
* @since 1.0.0
* @return void
*/
public function __construct()
{
/* Widget variable settings. */
$this->woo_widget_cssclass = 'widget_woo_component';
$this->woo_widget_description = __('This is a WooThemes standardized component loading widget. Intended primarily for use in the "Homepage" widget region.', 'woothemes');
$this->woo_widget_idbase = 'woo_component';
$this->woo_widget_title = __('Woo - Component', 'woothemes');
$this->woo_widget_componentslist = array('posts-timeline' => __('Posts Timeline', 'woothemes'), 'blog-posts' => __('Blog Posts', 'woothemes'), 'page-content' => __('Page Content', 'woothemes'), 'contact-area' => __('Contact Area', 'woothemes'));
if (is_woocommerce_activated()) {
$this->woo_widget_componentslist['hero-product'] = __('Hero Product', 'woothemes');
$this->woo_widget_componentslist['featured-products'] = __('Featured Products', 'woothemes');
}
/* Widget settings. */
$widget_ops = array('classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description);
/* Widget control settings. */
$control_ops = array('width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase);
/* Create the widget. */
$this->WP_Widget($this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops);
}
示例15: Woo_Widget_Component
function Woo_Widget_Component()
{
/* Widget variable settings. */
$this->woo_widget_cssclass = 'widget_woo_component';
$this->woo_widget_idbase = 'woo_component';
$this->woo_widget_componenttitle = __('Component', 'woothemes');
$this->woo_widget_title = __('Woo - ', 'woothemes') . $this->woo_widget_componenttitle;
$this->woo_widget_description = sprintf(__('This is a WooThemes standardized component widget for loading components into a custom layout.', 'woothemes'));
$this->woo_widget_componentslist = array('features' => __('Features', 'woothemes'), 'portfolio' => __('Portfolio', 'woothemes'), 'blog' => __('Content/Blog', 'woothemes'), 'blog-alt' => __('Blog Alternate Layout', 'woothemes'));
if (is_woocommerce_activated()) {
$this->woo_widget_componentslist['shop'] = __('Shop', 'woothemes');
}
/* Widget settings. */
$this->widget_ops = array('classname' => $this->woo_widget_cssclass, 'description' => $this->woo_widget_description);
/* Widget control settings. */
$this->control_ops = array('width' => 250, 'height' => 350, 'id_base' => $this->woo_widget_idbase);
/* Create the widget. */
$this->WP_Widget($this->woo_widget_idbase, $this->woo_widget_title, $this->widget_ops, $this->control_ops);
}