本文整理匯總了PHP中is_product_tag函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_product_tag函數的具體用法?PHP is_product_tag怎麽用?PHP is_product_tag使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_product_tag函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wcva_register_shop_scripts
public function wcva_register_shop_scripts()
{
if (is_shop() || is_product_category() || is_product_tag()) {
wp_enqueue_script('wcva-shop-frontend', '' . wcva_PLUGIN_URL . 'js/shop-frontend.js', array('jquery'));
wp_enqueue_style('wcva-shop-frontend', '' . wcva_PLUGIN_URL . 'css/shop-frontend.css');
}
}
示例2: siw_remove_unnecessary_scripts
function siw_remove_unnecessary_scripts()
{
//variatie als radiobuttons
if (!is_product()) {
wp_dequeue_script('kt-wc-add-to-cart-variation-radio');
}
//woocommerce ajax filter
if (!is_shop() && !is_product_category() && !is_product_tag()) {
wp_dequeue_script('yith-wcan-script');
wp_dequeue_style('yith-wcan-frontend');
}
//woocommerce
wp_dequeue_script('woocommerce');
//wp-embed
wp_deregister_script('wp-embed');
//search&filter
wp_dequeue_style('search-filter-chosen-styles');
wp_dequeue_style('search-filter-plugin-styles');
wp_deregister_script('search-filter-chosen-script');
wp_deregister_script('jquery-ui-datepicker');
wp_deregister_script('search-filter-plugin-build');
wp_register_script('search-filter-plugin-build', plugins_url('search-filter-pro/public/assets/js/search-filter-build.min.js'), array('jquery'), '', TRUE);
//kadence slider wordt alleen gebruikt op de homepage.
if (!is_front_page()) {
wp_dequeue_script('kadence_slider_js');
wp_dequeue_style('kadence_slider_css');
}
//ncf font
wp_dequeue_style('ncf_lato_font');
//styling van mailpoet widget
wp_deregister_style('validate-engine-css');
}
示例3: tesseract_woocommerce_wrapper_start
function tesseract_woocommerce_wrapper_start()
{
$layout_loop = get_theme_mod('tesseract_woocommerce_loop_layout');
$layout_product = get_theme_mod('tesseract_woocommerce_product_layout');
if (is_shop() || is_product_category() || is_product_tag()) {
if ($layout_loop == 'sidebar-left' || $layout_loop == 'sidebar-right') {
$primclass = 'with-sidebar';
$primclass .= $layout_loop == 'sidebar-left' ? ' sidebar-left' : ' sidebar-right';
} else {
if ($layout_loop == 'fullwidth' || !$layout_loop) {
$primclass = 'no-sidebar';
}
}
} else {
if (is_product()) {
if ($layout_product == 'sidebar-left' || $layout_product == 'sidebar-right') {
$primclass = 'with-sidebar';
$primclass .= $layout_product == 'sidebar-left' ? ' sidebar-left' : ' sidebar-right';
} else {
if ($layout_product == 'fullwidth' || !$layout_product) {
$primclass = 'no-sidebar';
}
}
} else {
$primclass = 'sidebar-default';
}
}
echo '<div id="primary" class="content-area ' . $primclass . '">';
}
示例4: setup_gridlist
function setup_gridlist()
{
if (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {
add_action('wp_enqueue_scripts', array($this, 'setup_scripts_script'), 20);
add_action('woocommerce_before_shop_loop', array($this, 'gridlist_toggle_button'), 10);
}
}
示例5: ts_get_opt
/**
* Get theme option value
* @param string $option
* @return mix|boolean
*/
function ts_get_opt($option)
{
global $ts_theme_options;
$local = false;
//get local from main shop page
if (class_exists('WooCommerce') && (is_shop() || is_product_category() || is_product_tag())) {
$shop_page = woocommerce_get_page_id('shop');
if (!empty($shop_page)) {
$value = ts_get_post_opt($option . '-local', (int) $shop_page);
$local = true;
}
//get local from metaboxes for the post value and override if not empty
} else {
if (is_singular()) {
$value = ts_get_post_opt($option . '-local');
$local = true;
}
}
//return local value if exists
if ($local === true) {
//if $value is an array we need to check if first element is not empty before we return $value
$first_element = null;
if (is_array($value)) {
$first_element = reset($value);
}
if (is_string($value) && (strlen($value) > 0 || !empty($value)) || is_array($value) && !empty($first_element)) {
return $value;
}
}
if (isset($ts_theme_options[$option])) {
return $ts_theme_options[$option];
}
return false;
}
示例6: dt_woocommerce_init_template_config
/**
* Init theme config for shop.
*
*/
function dt_woocommerce_init_template_config($name = '')
{
dt_woocommerce_add_config_actions();
if ('shop' != $name) {
return;
}
$config = presscore_get_config();
$post_id = null;
if (is_shop()) {
$post_id = woocommerce_get_page_id('shop');
} else {
if (is_cart()) {
$post_id = woocommerce_get_page_id('cart');
} else {
if (is_checkout()) {
$post_id = woocommerce_get_page_id('checkout');
}
}
}
presscore_config_base_init($post_id);
if (is_product_category() || is_product_tag()) {
$post_id = woocommerce_get_page_id('shop');
if ($post_id) {
$config->set('post_id', $post_id);
presscore_config_populate_sidebar_and_footer_options();
$config->set('post_id', null);
}
}
if (!is_product()) {
add_filter('presscore_get_page_title', 'dt_woocommerce_get_page_title', 20);
}
// replace theme breadcrumbs
add_filter('presscore_get_breadcrumbs-html', 'dt_woocommerce_replace_theme_breadcrumbs', 20, 2);
}
示例7: setup_scripts_script
function setup_scripts_script()
{
if (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {
wp_enqueue_script('cookie', plugins_url('/assets/js/jquery.cookie.min.js', __FILE__), array('jquery'));
wp_enqueue_script('grid-list-scripts', plugins_url('/assets/js/jquery.gridlistview.min.js', __FILE__), array('jquery'));
add_action('wp_footer', array(&$this, 'gridlist_set_default_view'));
}
}
示例8: is_woocommerce
/**
* WooCommerce conditionals
*
* is_woocommerce - Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included)
**/
function is_woocommerce()
{
if (is_shop() || is_product_category() || is_product_tag() || is_product()) {
return true;
} else {
return false;
}
}
示例9: kadence_sidebar_id
function kadence_sidebar_id()
{
if (is_front_page()) {
global $virtue;
if (!empty($virtue['home_sidebar'])) {
$sidebar = $virtue['home_sidebar'];
} else {
$sidebar = 'sidebar-primary';
}
} else {
if (class_exists('woocommerce') and is_shop() || is_product_category() || is_product_tag()) {
global $virtue;
if (!empty($virtue['shop_sidebar'])) {
$sidebar = $virtue['shop_sidebar'];
} else {
$sidebar = 'sidebar-primary';
}
} elseif (class_exists('woocommerce') and is_account_page()) {
get_template_part('templates/account', 'sidebar');
$sidebar = "";
} elseif (is_page_template('page-blog.php') || is_page_template('page-sidebar.php') || is_page_template('page-feature-sidebar.php') || get_post_type() == 'post') {
global $post;
$sidebar_name = get_post_meta($post->ID, '_kad_sidebar_choice', true);
if (!empty($sidebar_name)) {
$sidebar = $sidebar_name;
} else {
$sidebar = 'sidebar-primary';
}
} else {
if (is_archive()) {
$sidebar = 'sidebar-primary';
} else {
if (is_category()) {
$sidebar = 'sidebar-primary';
} elseif (is_tag()) {
$sidebar = 'sidebar-primary';
} elseif (is_post_type_archive()) {
$sidebar = 'sidebar-primary';
} elseif (is_day()) {
$sidebar = 'sidebar-primary';
} elseif (is_month()) {
$sidebar = 'sidebar-primary';
} elseif (is_year()) {
$sidebar = 'sidebar-primary';
} elseif (is_author()) {
$sidebar = 'sidebar-primary';
} elseif (is_search()) {
$sidebar = 'sidebar-primary';
} else {
$sidebar = 'sidebar-primary';
}
}
}
}
return apply_filters('kadence_sidebar_id', $sidebar);
}
示例10: amt_is_woocommerce_product_group
function amt_is_woocommerce_product_group()
{
// Check if woocommerce product group page and return true;
// WooCommerce (http://docs.woothemes.com/document/conditional-tags/)
// Also validates with is_tax().
if (function_exists('is_product_category') || function_exists('is_product_tag')) {
if (is_product_category() || is_product_tag()) {
return true;
}
}
}
示例11: nimber_show_per_row
function nimber_show_per_row()
{
if (is_shop()) {
$woo_layout = ot_get_option('woo_layout');
} elseif (is_product_category() || is_product_tag()) {
$woo_layout = ot_get_option('woo_archive_layout');
} else {
$woo_layout = 4;
}
return $woo_layout;
}
示例12: get_page_base_url
/**
* Get current page URL for layered nav items.
*
* @return string
*/
protected function get_page_base_url()
{
if (defined('SHOP_IS_ON_FRONT')) {
$link = home_url();
} elseif (is_post_type_archive('product') || is_page(wc_get_page_id('shop'))) {
$link = get_post_type_archive_link('product');
} elseif (is_product_category()) {
$link = get_term_link(get_query_var('product_cat'), 'product_cat');
} elseif (is_product_tag()) {
$link = get_term_link(get_query_var('product_tag'), 'product_tag');
} else {
$queried_object = get_queried_object();
$link = get_term_link($queried_object->slug, $queried_object->taxonomy);
}
// Min/Max
if (isset($_GET['min_price'])) {
$link = add_query_arg('min_price', wc_clean($_GET['min_price']), $link);
}
if (isset($_GET['max_price'])) {
$link = add_query_arg('max_price', wc_clean($_GET['max_price']), $link);
}
// Orderby
if (isset($_GET['orderby'])) {
$link = add_query_arg('orderby', wc_clean($_GET['orderby']), $link);
}
/**
* Search Arg.
* To support quote characters, first they are decoded from " entities, then URL encoded.
*/
if (get_search_query()) {
$link = add_query_arg('s', rawurlencode(htmlspecialchars_decode(get_search_query())), $link);
}
// Post Type Arg
if (isset($_GET['post_type'])) {
$link = add_query_arg('post_type', wc_clean($_GET['post_type']), $link);
}
// Min Rating Arg
if (isset($_GET['min_rating'])) {
$link = add_query_arg('min_rating', wc_clean($_GET['min_rating']), $link);
}
// All current filters
if ($_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes()) {
foreach ($_chosen_attributes as $name => $data) {
$filter_name = sanitize_title(str_replace('pa_', '', $name));
if (!empty($data['terms'])) {
$link = add_query_arg('filter_' . $filter_name, implode(',', $data['terms']), $link);
}
if ('or' == $data['query_type']) {
$link = add_query_arg('query_type_' . $filter_name, 'or', $link);
}
}
}
return $link;
}
示例13: setup_gridlist
function setup_gridlist()
{
if (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy()) {
add_action('wp_enqueue_scripts', array($this, 'setup_scripts_styles'), 20);
add_action('wp_enqueue_scripts', array($this, 'setup_scripts_script'), 20);
add_action('woocommerce_before_shop_loop', array($this, 'gridlist_toggle_button'), 30);
add_action('woocommerce_after_shop_loop_item', array($this, 'gridlist_buttonwrap_open'), 9);
add_action('woocommerce_after_shop_loop_item', array($this, 'gridlist_buttonwrap_close'), 11);
add_action('woocommerce_after_shop_loop_item', array($this, 'gridlist_hr'), 30);
add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_single_excerpt', 5);
add_action('woocommerce_after_subcategory', array($this, 'gridlist_cat_desc'));
}
}
示例14: kadence_sidebar_on_shop_page
function kadence_sidebar_on_shop_page()
{
global $virtue;
if (isset($virtue['shop_layout']) && $virtue['shop_layout'] == 'sidebar') {
if (is_shop() || is_product_category() || is_product_tag()) {
return false;
}
} else {
if (is_shop() || is_product_category() || is_product_tag()) {
return true;
}
}
}
示例15: sidebar_options
/**
* Get sidebar settings based on the page type
*
* @return array
*/
public function sidebar_options()
{
if (is_home()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
} elseif (function_exists('is_bbpress') && is_bbpress()) {
$sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
if (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
}
} elseif (function_exists('is_buddypress') && is_buddypress()) {
$sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
} elseif (class_exists('WooCommerce') && (is_product() || is_shop())) {
$sidebars = array('global' => Avada()->settings->get('woo_global_sidebar'), 'sidebar_1' => Avada()->settings->get('woo_sidebar'), 'sidebar_2' => Avada()->settings->get('woo_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
} elseif (class_exists('WooCommerce') && (is_product_category() || is_product_tag())) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('woocommerce_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('woocommerce_archive_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
} elseif (is_page()) {
$sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
} elseif (is_single()) {
$sidebars = array('global' => Avada()->settings->get('posts_global_sidebar'), 'sidebar_1' => Avada()->settings->get('posts_sidebar'), 'sidebar_2' => Avada()->settings->get('posts_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
if (is_singular('avada_portfolio')) {
$sidebars = array('global' => Avada()->settings->get('portfolio_global_sidebar'), 'sidebar_1' => Avada()->settings->get('portfolio_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
} else {
if (is_singular('tribe_events') || is_singular('tribe_organizer') || is_singular('tribe_venue')) {
$sidebars = array('global' => Avada()->settings->get('ec_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
}
}
if (is_singular('tribe_organizer') || is_singular('tribe_venue')) {
$sidebars['global'] = 1;
}
} elseif (is_archive()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
if (is_post_type_archive('avada_portfolio') || is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags')) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('portfolio_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_archive_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
}
} elseif (is_search()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('search_sidebar'), 'sidebar_2' => Avada()->settings->get('search_sidebar_2'), 'position' => Avada()->settings->get('search_sidebar_position'));
} else {
$sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
}
if (class_exists('Tribe__Events__Main') && is_events_archive()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
}
// Remove sidebars from the certain woocommerce pages
if (class_exists('WooCommerce')) {
if (is_cart() || is_checkout() || is_account_page() || get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))) {
$sidebars = array();
}
}
return $sidebars;
}