本文整理汇总了PHP中wpsc_is_in_category函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsc_is_in_category函数的具体用法?PHP wpsc_is_in_category怎么用?PHP wpsc_is_in_category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpsc_is_in_category函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wpsc_body_class
/**
* Body Class Filter
* @modified: 2009-10-14 by Ben
* @description: Adds additional wpsc classes to the body tag.
* @param: $classes = Array of body classes
* @return: (Array) of classes
*
* @uses get_permalink() Returns WP permalink given post_id
* @uses get_option() Returns option value given key
* @uses get_post_type() Returns string for registered post_type name
* @uses wpsc_is_single_product() Returns true if we are on a single product
* @uses wpsc_is_in_category() Returns true if we are on a WPSC product cat
* @uses wpsc_is_in_tag() Returns true if we are on a WPSC product tag
* @usse esc_attr() Keeping things safe just in case
*/
function wpsc_body_class($classes)
{
global $wp_query, $wpsc_query;
$post_id = get_the_ID();
if ($post_id) {
$page_url = get_permalink($post_id);
// If on a product or category page...
if (get_option('product_list_url') == $page_url || get_post_type($post_id) === 'wpsc-product') {
$classes[] = 'wp-e-commerce';
if (!is_array($wpsc_query->query)) {
$classes[] = 'wpsc-home';
}
if (wpsc_is_single_product()) {
$object = $wp_query->get_queried_object();
$classes[] = 'wpsc-single-product';
if (absint($object->ID) > 0) {
$classes[] = 'wpsc-single-product-' . absint($object->ID);
}
}
if (wpsc_is_in_category() && !wpsc_is_single_product()) {
$classes[] = 'wpsc-category';
$tax_object = $wp_query->get_queried_object();
$classes[] = 'wpsc-category-' . esc_attr($tax_object->slug);
}
if (wpsc_is_in_tag() && !wpsc_is_single_product()) {
$classes[] = 'wpsc-tag';
$tax_object = $wp_query->get_queried_object();
$classes[] = 'wpsc-tag-' . esc_attr($tax_object->slug);
}
}
// If viewing the shopping cart...
if (get_option('shopping_cart_url') == $page_url) {
$classes[] = 'wp-e-commerce';
$classes[] = 'wpsc-shopping-cart';
}
// If viewing the transaction...
if (get_option('transact_url') == $page_url) {
$classes[] = 'wp-e-commerce';
$classes[] = 'wpsc-transaction-details';
}
// If viewing your account...
if (get_option('user_account_url') == $page_url) {
$classes[] = 'wp-e-commerce';
$classes[] = 'wpsc-user-account';
}
}
return $classes;
}
开发者ID:ashik968,项目名称:digiplot,代码行数:63,代码来源:template.php
示例2: if
<?php if(get_option('wpsc_category_description')) :?>
<?php wpsc_print_category_description("<div class='wpsc_subcategory'>", "</div>"); ?>
<?php endif;?>
<?php wpsc_print_subcategory("<ul>", "</ul>"); ?>
</li>
<?php wpsc_end_category_query(); ?>
</ul>
<?php endif; ?>
<?php endif; ?>
<?php if(wpsc_display_products()): ?>
<?php if(wpsc_is_in_category()) : ?>
<div class='wpsc_category_details'>
<?php if(get_option('show_category_thumbnails') && wpsc_category_image()) : ?>
<img src='<?php echo wpsc_category_image(); ?>' alt='<?php echo wpsc_category_name(); ?>' title='<?php echo wpsc_category_name(); ?>' />
<?php endif; ?>
<?php if(get_option('wpsc_category_description') && wpsc_category_description()) : ?>
<?php echo wpsc_category_description(); ?>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- Start Pagination -->
<?php if ( ( get_option( 'use_pagination' ) == 1 && ( get_option( 'wpsc_page_number_position' ) == 1 || get_option( 'wpsc_page_number_position' ) == 3 ) ) ) : ?>
<div class="wpsc_page_numbers">
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:list_view.php
示例3:
?>
</ul>
<?php
}
?>
<?php
}
// */
?>
<?php
if (wpsc_display_products()) {
?>
<?php
if (wpsc_is_in_category()) {
?>
<div class="wpsc_category_details">
<?php
if (wpsc_show_category_thumbnails()) {
?>
<img src="<?php
echo wpsc_category_image();
?>
" alt="<?php
echo wpsc_category_name();
?>
" />
<?php
}
?>
开发者ID:B1aZer,项目名称:yaltatoys_wp,代码行数:31,代码来源:wpsc-products_page.php
示例4: wpsc_body_class
/**
* Body Class Filter
* @modified: 2009-10-14 by Ben
* @description: Adds additional wpsc classes to the body tag.
* @param: $classes = Array of body classes
* @return: (Array) of classes
*/
function wpsc_body_class($classes)
{
global $wp_query, $wpsc_query;
$post_id = $wp_query->post->ID;
$page_url = get_permalink($post_id);
// If on a product or category page...
if (get_option('product_list_url') == $page_url) {
$classes[] = 'wpsc';
if (!is_array($wpsc_query->query)) {
$classes[] = 'wpsc-home';
}
if (wpsc_is_single_product()) {
$classes[] = 'wpsc-single-product';
if (absint($wpsc_query->products[0]['id']) > 0) {
$classes[] = 'wpsc-single-product-' . $wpsc_query->products[0]['id'];
}
}
if (wpsc_is_in_category() && !wpsc_is_single_product()) {
$classes[] = 'wpsc-category';
}
if (absint($wpsc_query->query_vars['category_id']) > 0) {
$classes[] = 'wpsc-category-' . $wpsc_query->query_vars['category_id'];
}
if (absint(wpsc_category_group()) > 0) {
$classes[] = 'wpsc-group-' . wpsc_category_group();
}
}
// If viewing the shopping cart...
if (get_option('shopping_cart_url') == $page_url) {
$classes[] = 'wpsc';
$classes[] = 'wpsc-shopping-cart';
}
// If viewing the transaction...
if (get_option('transact_url') == $page_url) {
$classes[] = 'wpsc';
$classes[] = 'wpsc-transaction-details';
}
// If viewing your account...
if (get_option('user_account_url') == $page_url) {
$classes[] = 'wpsc';
$classes[] = 'wpsc-user-account';
}
return $classes;
}
开发者ID:papayalabs,项目名称:htdocs,代码行数:51,代码来源:theme.functions.php
示例5: add_category_page_bottom_elements
public function add_category_page_bottom_elements()
{
if (wpsc_is_in_category()) {
$default_element_ids = array('productcategory-retargeting-2');
$element_ids = apply_filters('wpecnt_add_category_page_bottom_elements', $default_element_ids);
if (is_array($element_ids) && !empty($element_ids)) {
$this->render('retargeting-elements', array('element_ids' => $element_ids));
}
}
}
开发者ID:retargeting,项目名称:WP-eCommerce,代码行数:10,代码来源:wpec-retargeting.php
注:本文中的wpsc_is_in_category函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论