本文整理汇总了PHP中is_woocommerce_activated函数的典型用法代码示例。如果您正苦于以下问题:PHP is_woocommerce_activated函数的具体用法?PHP is_woocommerce_activated怎么用?PHP is_woocommerce_activated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_woocommerce_activated函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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');
}
开发者ID:plusplusminus,项目名称:athol,代码行数:27,代码来源:theme-js.php
示例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;
}
开发者ID:chillinhen,项目名称:up2you-storefront,代码行数:12,代码来源:functions.php
示例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');
}
开发者ID:soydiegomen,项目名称:plazajilo,代码行数:33,代码来源:theme-js.php
示例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
}
}
开发者ID:quinntron,项目名称:tmad,代码行数:27,代码来源:template-tags.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;
}
开发者ID:pootlepress,项目名称:18-tags,代码行数:12,代码来源:functions.php
示例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);
}
开发者ID:andrecavalcanti,项目名称:lingerievision,代码行数:31,代码来源:structure.php
示例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;
}
开发者ID:nakerlund,项目名称:storefront,代码行数:12,代码来源:class-storefront-woocommerce.php
示例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);
}
}
}
开发者ID:Nsy,项目名称:storefront_c,代码行数:9,代码来源:template_style.php
示例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');
}
开发者ID:andisultan,项目名称:calibrefx,代码行数:10,代码来源:functions.php
示例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';
}
}
开发者ID:boguslawski-piotr,项目名称:pbo-tools,代码行数:13,代码来源:pbo-tools.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
}
}
开发者ID:KhallebRibeiro,项目名称:odin,代码行数:22,代码来源:template-tags.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
}
}
开发者ID:javalidigital,项目名称:tecnigrav,代码行数:17,代码来源:woocommerce-support.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
}
}
}
开发者ID:editiontirol,项目名称:site-theme,代码行数:18,代码来源:template-tags.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);
}
开发者ID:sanjeevpraja,项目名称:wordpress-theme,代码行数:24,代码来源:widget-woo-component.php
示例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);
}
开发者ID:jaiweb,项目名称:ASP,代码行数:19,代码来源:widget-woo-componentbase.php
示例16: __construct
/**
* Constructor function.
* @since 1.0.0
* @return void
*/
public function __construct()
{
/* Widget variable settings. */
$this->woo_widget_cssclass = 'widget_sensei_course_component';
$this->woo_widget_description = __('This widget will output a list of Courses - New, Featured, Free, Paid, Active, Completed.', 'woothemes-sensei');
$this->woo_widget_idbase = 'sensei_course_component';
$this->woo_widget_title = __('Sensei - Course Component', 'woothemes-sensei');
$this->woo_widget_componentslist = array('usercourses' => __('New Courses', 'woothemes-sensei'), 'featuredcourses' => __('Featured Courses', 'woothemes-sensei'), 'activecourses' => __('My Active Courses', 'woothemes-sensei'), 'completedcourses' => __('My Completed Courses', 'woothemes-sensei'));
// Add support for the WooCommerce shelf.
if (function_exists('is_woocommerce_activated') && is_woocommerce_activated()) {
$this->woo_widget_componentslist['freecourses'] = __('Free Courses', 'woothemes-sensei');
$this->woo_widget_componentslist['paidcourses'] = __('Paid Courses', 'woothemes-sensei');
}
/* 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. */
parent::__construct($this->woo_widget_idbase, $this->woo_widget_title, $widget_ops, $control_ops);
}
开发者ID:Ezyva2015,项目名称:opendooronline.com.au,代码行数:25,代码来源:widget-woothemes-sensei-course-component.php
示例17: init
public function init()
{
wp_localize_script('etp-script', 'sfpSettings', array('shopLayout' => false, 'mobStore' => false, 'infiniteScroll' => false));
if (!is_woocommerce_activated()) {
$this->css .= '.wc-18-tags-active #site-navigation > div { width: 100%; }';
return;
}
add_filter('eighteen_tags_loop_columns', array($this, 'columns'), 999);
//Header cart display
$header_cart = $this->get('header-wc-cart');
add_action('wc_18_tags_in' . $header_cart . '_nav', 'eighteen_tags_header_cart');
if (!empty($header_cart)) {
add_action('wc_18_tags_in_nav', 'eighteen_tags_header_cart');
WooCommerce_18_Tags_Public::$desktop_css .= '#site-navigation.main-navigation .site-header-cart { display: none !important; }';
$this->css .= '.wc-18-tags-active #site-navigation > div { width: 100%; }';
}
//Header cart color
$this->css .= '.wc-18-tags-active .site-header-cart .cart-contents { color: ' . $this->get('header-wc-cart-color', '#000000') . '; }';
$is_product_archive = is_shop() || is_product_taxonomy();
$is_checkout_process = is_cart() || is_checkout();
$this->set_styles($is_product_archive, $is_checkout_process);
}
开发者ID:pootlepress,项目名称:18tags-wc-add-on,代码行数:22,代码来源:class-woocommerce.php
示例18: e_commerce_cart_link
function e_commerce_cart_link()
{
if (is_woocommerce_activated()) {
?>
<div class="cart-contents cart_totals">
<a href="<?php
echo esc_url(WC()->cart->get_cart_url());
?>
" title="<?php
_e('View cart', 'e-commerce');
?>
">
<span class="cart-icon"></span><span class="subtotal"><?php
echo wp_kses_data(WC()->cart->get_cart_subtotal());
?>
</span> <span class="count"><?php
echo wp_kses_data(sprintf(_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'e-commerce'), WC()->cart->get_cart_contents_count()));
?>
</span>
</a>
</div>
<?php
}
}
开发者ID:kuem2405,项目名称:backend,代码行数:24,代码来源:woocommerce.php
示例19: odin_breadcrumbs
/**
* Breadcrumbs.
*
* @since 2.2.0
*
* @param string $homepage Homepage name.
*
* @return string HTML of breadcrumbs.
*/
function odin_breadcrumbs($homepage = '')
{
global $wp_query, $post, $author;
!empty($homepage) || ($homepage = __('Home', 'odin'));
// Default html.
$current_before = '<li class="active">';
$current_after = '</li>';
if (!is_home() && !is_front_page() || is_paged()) {
// First level.
echo '<ol id="breadcrumbs" class="breadcrumb">';
echo '<li><a href="' . home_url() . '" rel="nofollow">' . $homepage . '</a></li>';
// Single post.
if (is_single() && !is_attachment()) {
// Checks if is a custom post type.
if ('post' != $post->post_type) {
// But if Woocommerce
if ('product' === $post->post_type) {
if (is_woocommerce_activated()) {
$shop_page = get_post(wc_get_page_id('shop'));
echo '<li><a href="' . get_permalink($shop_page) . '">' . get_the_title($shop_page) . '</a></li>';
}
// Gets post type taxonomies.
$taxonomy = get_object_taxonomies('product');
$taxy = 'product_cat';
} else {
$post_type = get_post_type_object($post->post_type);
echo '<li><a href="' . get_post_type_archive_link($post_type->name) . '">' . $post_type->label . '</a></li> ';
// Gets post type taxonomies.
$taxonomy = get_object_taxonomies($post_type->name);
}
if ($taxonomy) {
$taxy = $taxonomy[0];
// Gets post terms.
$terms = get_the_terms($post->ID, $taxy);
$term = $terms ? array_shift($terms) : '';
// Gets parent post terms.
$parent_term = get_term($term->parent, $taxy);
if ($term) {
if ($term->parent) {
echo '<li><a href="' . get_term_link($parent_term) . '">' . $parent_term->name . '</a></li> ';
}
echo '<li><a href="' . get_term_link($term) . '">' . $term->name . '</a></li> ';
}
}
} else {
$category = get_the_category();
$category = $category[0];
// Gets parent post terms.
$parent_cat = get_term($category->parent, 'category');
// Gets top term
$cat_tree = get_category_parents($category, FALSE, ':');
$top_cat = explode(':', $cat_tree);
$top_cat = $top_cat[0];
if ($category->parent) {
if ($parent_cat->parent) {
echo '<li><a href="' . get_term_link($top_cat, 'category') . '">' . $top_cat . '</a></li>';
}
echo '<li><a href="' . get_term_link($parent_cat) . '">' . $parent_cat->name . '</a></li>';
}
echo '<li><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
}
echo $current_before . get_the_title() . $current_after;
// Single attachment.
} elseif (is_attachment()) {
$parent = get_post($post->post_parent);
$category = get_the_category($parent->ID);
$category = $category[0];
echo '<li><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
echo '<li><a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a></li>';
echo $current_before . get_the_title() . $current_after;
// Page without parents.
} elseif (is_page() && !$post->post_parent) {
echo $current_before . get_the_title() . $current_after;
// Page with parents.
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '<li><a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a></li>';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) {
echo $crumb . ' ';
}
echo $current_before . get_the_title() . $current_after;
// Category archive.
} elseif (is_category()) {
$category_object = $wp_query->get_queried_object();
$category_id = $category_object->term_id;
//.........这里部分代码省略.........
开发者ID:trfiladelfo,项目名称:odin,代码行数:101,代码来源:helpers.php
示例20: get_template_directory
*/
require_once get_template_directory() . '/core/helpers.php';
/**
* WP Custom Admin.
*/
require_once get_template_directory() . '/inc/admin.php';
/**
* Comments loop.
*/
require_once get_template_directory() . '/inc/comments-loop.php';
/**
* WP optimize functions.
*/
require_once get_template_directory() . '/inc/optimize.php';
/**
* WP Hooks.
*/
require_once get_template_directory() . '/inc/hooks.php';
/**
* Custom template tags.
*/
require_once get_template_directory() . '/inc/template-tags.php';
/**
* WooCommerce compatibility files.
*/
if (is_woocommerce_activated()) {
add_theme_support('woocommerce');
require get_template_directory() . '/inc/woocommerce/hooks.php';
require get_template_directory() . '/inc/woocommerce/functions.php';
require get_template_directory() . '/inc/woocommerce/template-tags.php';
}
开发者ID:amandagpearce,项目名称:aef,代码行数:31,代码来源:functions.php
注:本文中的is_woocommerce_activated函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论