• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP woocommerce_product_subcategories函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中woocommerce_product_subcategories函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_product_subcategories函数的具体用法?PHP woocommerce_product_subcategories怎么用?PHP woocommerce_product_subcategories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了woocommerce_product_subcategories函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: woocommerce_content

    /**
     * Output WooCommerce content.
     *
     * This function is only used in the optional 'woocommerce.php' template.
     * which people can add to their themes to add basic woocommerce support.
     * without hooks or modifying core templates.
     *
     */
    function woocommerce_content()
    {
        if (is_singular('product')) {
            while (have_posts()) {
                the_post();
                wc_get_template_part('content', 'single-product');
            }
        } else {
            ?>

			<?php 
            if (apply_filters('woocommerce_show_page_title', true)) {
                ?>

				<h1 class="page-title"><?php 
                woocommerce_page_title();
                ?>
</h1>

			<?php 
            }
            ?>

			<?php 
            do_action('woocommerce_archive_description');
            ?>

			<?php 
            if (have_posts()) {
                ?>

				<?php 
                do_action('woocommerce_before_shop_loop');
                ?>

				<?php 
                woocommerce_product_loop_start();
                ?>

					<?php 
                woocommerce_product_subcategories();
                ?>

					<?php 
                while (have_posts()) {
                    the_post();
                    ?>

						<?php 
                    wc_get_template_part('content', 'product');
                    ?>

					<?php 
                }
                // end of the loop.
                ?>

				<?php 
                woocommerce_product_loop_end();
                ?>

				<?php 
                do_action('woocommerce_after_shop_loop');
                ?>

			<?php 
            } elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
                ?>

				<?php 
                do_action('woocommerce_no_products_found');
                ?>

			<?php 
            }
        }
    }
开发者ID:woocommerce,项目名称:woocommerce,代码行数:85,代码来源:wc-template-functions.php


示例2: element

    /**
     * This method is used to display the output of the element.
     * @return void
     */
    function element()
    {
        // Check if this is a normal page or the Shop archive page
        if (!is_shop()) {
            global $paged;
            $wc_query = new WC_Query();
            // Get the proper page - this resolves the pagination on static frontpage
            if (get_query_var('paged')) {
                $paged = get_query_var('paged');
            } elseif (get_query_var('page')) {
                $paged = get_query_var('page');
            } else {
                $paged = 1;
            }
            $ordering = $wc_query->get_catalog_ordering_args();
            $queryArgs = array('post_type' => 'product', 'paged' => $paged, 'orderby' => $ordering['orderby'], 'order' => $ordering['order']);
            if (isset($ordering['meta_key'])) {
                $queryArgs['meta_key'] = $ordering['meta_key'];
            }
            query_posts($queryArgs);
        }
        // Change the number of columns
        add_filter('loop_shop_columns', array(&$this, 'zn_woo_loop_columns'), 999);
        $sidebar_tweak = $this->opt('num_columns', '4') == 3 ? 'left_sidebar' : '';
        echo '<div class="zn_woo_archive_elemenent woocommerce ' . $this->data['uid'] . ' ' . $sidebar_tweak . ' ' . $this->opt('css_class', '') . '">';
        ?>

		<?php 
        if ($this->opt('show_page_title', 'yes') == 'yes') {
            ?>
			<h1 class="page-title"><?php 
            woocommerce_page_title();
            ?>
</h1>
		<?php 
        }
        ?>

		<?php 
        /**
         * woocommerce_archive_description hook
         *
         * @hooked woocommerce_taxonomy_archive_description - 10
         * @hooked woocommerce_product_archive_description - 10
         */
        do_action('woocommerce_archive_description');
        ?>

		<?php 
        if (have_posts()) {
            ?>

		<?php 
            /**
             * woocommerce_before_shop_loop hook
             *
             * @hooked woocommerce_result_count - 20
             * @hooked woocommerce_catalog_ordering - 30
             */
            do_action('woocommerce_before_shop_loop');
            ?>

		<?php 
            woocommerce_product_loop_start();
            ?>

		<?php 
            woocommerce_product_subcategories();
            ?>

		<?php 
            while (have_posts()) {
                the_post();
                ?>

			<?php 
                wc_get_template_part('content', 'product');
                ?>

		<?php 
            }
            // end of the loop.
            ?>

		<?php 
            woocommerce_product_loop_end();
            ?>

		<?php 
            /**
             * woocommerce_after_shop_loop hook
             *
             * @hooked woocommerce_pagination - 10
             */
            do_action('woocommerce_after_shop_loop');
            ?>
//.........这里部分代码省略.........
开发者ID:rock1media,项目名称:wordpress,代码行数:101,代码来源:TH_ProductArchive.php


示例3: woocommerce_catalog_ordering

				<?php 
        woocommerce_catalog_ordering();
        ?>
				
			</div>
			<?php 
    }
    ?>
			
		</div>
		<?php 
}
?>
		
		<?php 
woocommerce_product_subcategories(array('before' => '<div class="shop-categories row">', 'after' => '</div>'));
?>
		
		<?php 
# end: modified by Arlind Nushi
?>

		<?php 
if (have_posts()) {
    ?>

			<?php 
    /**
     * woocommerce_before_shop_loop hook
     *
     * @hooked woocommerce_result_count - 20
开发者ID:adrienlementheour,项目名称:AliceRouat,代码行数:31,代码来源:archive-product.php


示例4: layers_center_column_class

if (have_posts()) {
    ?>
            <section <?php 
    layers_center_column_class();
    ?>
>

                <div class="row push-bottom woocommerce-result-count-container">
                    <?php 
    do_action('woocommerce_before_shop_loop');
    ?>
                </div>

                <?php 
    // Sub category listing
    woocommerce_product_subcategories();
    ?>

                <ul class="products row">
                    <?php 
    while (have_posts()) {
        the_post();
        ?>
                            <?php 
        woocommerce_get_template_part('content', 'product');
        ?>
                    <?php 
    }
    ?>
                </ul>
开发者ID:HackingWP,项目名称:layerswp,代码行数:30,代码来源:taxonomy-product_cat.php


示例5: miss_woocommerce_content

function miss_woocommerce_content()
{
    if (is_singular('product')) {
        while (have_posts()) {
            the_post();
            woocommerce_get_template_part('content', 'single-product');
        }
    } else {
        ?>

		<?php 
        if (apply_filters('woocommerce_show_page_title', true)) {
            ?>
            <div class="bread-container">
                <div class="bread-wrapper">
                    <div class="blog-title"><?php 
            woocommerce_page_title();
            ?>
</div>
                    <?php 
            dimox_breadcrumbs();
            ?>
                </div>
            </div>

		<?php 
        }
        ?>

		<?php 
        do_action('woocommerce_archive_description');
        ?>

		<?php 
        if (have_posts()) {
            ?>

			<?php 
            do_action('woocommerce_before_shop_loop');
            ?>

			<?php 
            woocommerce_product_loop_start();
            ?>

				<?php 
            woocommerce_product_subcategories();
            ?>

				<?php 
            while (have_posts()) {
                the_post();
                ?>

					<?php 
                woocommerce_get_template_part('content', 'product');
                ?>

				<?php 
            }
            // end of the loop.
            ?>

			<?php 
            woocommerce_product_loop_end();
            ?>

			<?php 
            do_action('woocommerce_after_shop_loop');
            ?>

		<?php 
        } elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
            ?>

			<?php 
            woocommerce_get_template('loop/no-products-found.php');
            ?>

		<?php 
        }
    }
}
开发者ID:schiz,项目名称:scrollax,代码行数:83,代码来源:theme.php


示例6: do_action

				</div>
    		<div class="clear"></div>
    
            <div class="toolbar bottom">
            	<?php 
    do_action('woocommerce_after_shop_loop');
    ?>
                <div class="clear"></div>
            </div>
    		
		<?php 
} else {
    ?>
		
			<?php 
    if (!woocommerce_product_subcategories(array('before' => '<ul class="products">', 'after' => '</ul>'))) {
        ?>
					
				<p class="error"><?php 
        _e('No products found which match your selection.', ETHEME_DOMAIN);
        ?>
</p>
					
			<?php 
    }
    ?>
		
		<?php 
}
?>
		
开发者ID:Nguyenkain,项目名称:hanghieusales,代码行数:30,代码来源:taxonomy-pa_brand.php


示例7: anaglyph_woo_get_loop_shop_content

    function anaglyph_woo_get_loop_shop_content()
    {
        global $anaglyph_config, $time_post_delay;
        $layout = 1;
        $class_content = 'col-md-12';
        $layout = esc_attr($anaglyph_config['shop-layout']);
        if ($layout > 1) {
            $class_content = 'col-md-9';
        }
        ?>
		<?php 
        /**
         * woocommerce_before_main_content hook
         *
         * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
         * @hooked woocommerce_breadcrumb - 20
         */
        do_action('woocommerce_before_main_content');
        do_action('woocommerce_archive_description');
        ?>
		<div class="<?php 
        echo $class_content;
        ?>
">	
	
		<?php 
        if (have_posts()) {
            ?>
			<?php 
            /**
             * woocommerce_before_shop_loop hook
             *
             * @hooked woocommerce_result_count - 20
             * @hooked woocommerce_catalog_ordering - 30
             */
            do_action('woocommerce_before_shop_loop');
            ?>
			<?php 
            woocommerce_product_loop_start();
            ?>
			<?php 
            woocommerce_product_subcategories();
            ?>
				<?php 
            while (have_posts()) {
                the_post();
                ?>
					<?php 
                wc_get_template_part('content', 'product');
                ?>
					<?php 
                $time_post_delay += 0.2;
                ?>
				<?php 
            }
            // end of the loop.
            ?>
			<?php 
            woocommerce_product_loop_end();
            ?>
			
			<?php 
            /**
             * woocommerce_after_shop_loop hook
             *
             * @hooked woocommerce_pagination - 10
             */
            do_action('woocommerce_after_shop_loop');
            ?>
		<?php 
        } elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
            ?>
			<?php 
            wc_get_template('loop/no-products-found.php');
            ?>
		<?php 
        }
        ?>
		</div> <!-- end products loop content -->
		
		
		<?php 
        /**
         * woocommerce_after_main_content hook
         *
         * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
         */
        do_action('woocommerce_after_main_content');
    }
开发者ID:junibrosas,项目名称:anaglyph,代码行数:89,代码来源:theme-woocommerce.php


示例8: content

        public static function content()
        {
            ?>
			<?php 
            if (is_singular('product')) {
                while (have_posts()) {
                    the_post();
                    wc_get_template_part('content', 'single-product');
                }
            } else {
                ?>
				<?php 
                /**
                 * script
                 * {{
                 */
                wp_enqueue_script('vendor-carouFredSel');
                ?>
				<?php 
                if (apply_filters('woocommerce_show_page_title', true)) {
                    ?>
	
					<h1 class="page-title"><?php 
                    woocommerce_page_title();
                    ?>
</h1>
	
				<?php 
                }
                ?>
				
				<?php 
                do_action('woocommerce_archive_description');
                ?>
				
				<?php 
                if (have_posts()) {
                    ?>
					<?php 
                    $current_view_mode = dh_get_theme_option('dh_woocommerce_view_mode', 'grid');
                    if (isset($_GET['mode']) && in_array($_GET['mode'], array('grid', 'list'))) {
                        $current_view_mode = $_GET['mode'];
                    }
                    $grid_mode_href = $current_view_mode == 'list' ? ' href="' . esc_url(add_query_arg('mode', 'grid')) . '"' : '';
                    $list_mode_href = $current_view_mode == 'grid' ? ' href="' . esc_url(add_query_arg('mode', 'list')) . '"' : '';
                    ?>
					<div class="shop-toolbar">
						<div class="view-mode">
							<a class="grid-mode<?php 
                    echo $current_view_mode == 'grid' ? ' active' : '';
                    ?>
" title="<?php 
                    esc_attr_e('Grid', DH_DOMAIN);
                    ?>
" <?php 
                    echo $grid_mode_href;
                    ?>
><i class="fa fa-th"></i></a>
							<a class="list-mode<?php 
                    echo $current_view_mode == 'list' ? ' active' : '';
                    ?>
" title="<?php 
                    esc_attr_e('List', DH_DOMAIN);
                    ?>
" <?php 
                    echo $list_mode_href;
                    ?>
><i class="fa fa-th-list"></i></a>
						</div>
						<?php 
                    do_action('woocommerce_before_shop_loop');
                    ?>
						<nav class="woocommerce-pagination">
						  <?php 
                    dh_paginate_links_short();
                    ?>
						</nav>
					</div>
					<div class="shop-loop <?php 
                    echo esc_attr($current_view_mode);
                    ?>
">
					<?php 
                    woocommerce_product_loop_start();
                    ?>
						<?php 
                    woocommerce_product_subcategories();
                    ?>
						<?php 
                    while (have_posts()) {
                        the_post();
                        ?>
	
							<?php 
                        wc_get_template_part('content', 'product');
                        ?>
	
						<?php 
                    }
                    // end of the loop.
//.........这里部分代码省略.........
开发者ID:mysia84,项目名称:mnassalska,代码行数:101,代码来源:woocommerce.php


示例9: absint

$_old_woocommerce_loop = $woocommerce_loop;
?>
					
					<?php 
//$woocommerce_loop = $_old_woocommerce_loop;
if (absint($wd_data['wd_prod_cat_column']) > 0) {
    $woocommerce_loop['columns'] = absint($wd_data['wd_prod_cat_column']);
}
?>
					
					<ul class="archive-product-subcategories">	
						<?php 
ob_start();
?>
						<?php 
$show_sub_cat = woocommerce_product_subcategories();
?>
						<?php 
echo $product_subcategories_html = ob_get_clean();
?>
					</ul>	

						
						
					<?php 
if (have_posts()) {
    ?>
						<div class="wd_meta_loop">
						<?php 
    /**
     * woocommerce_before_shop_loop hook
开发者ID:mynein,项目名称:myne,代码行数:31,代码来源:archive-product.php


示例10: prdctfltr_respond

 /**
  * Shortcode AJAX Respond
  */
 public static function prdctfltr_respond()
 {
     global $prdctfltr_global;
     $shortcode_params = explode('|', $_POST['pf_shortcode']);
     $preset = $shortcode_params[0] !== 'false' ? $shortcode_params[0] : '';
     $columns = $shortcode_params[1] !== 'false' ? $shortcode_params[1] : 4;
     $rows = $shortcode_params[2] !== 'false' ? $shortcode_params[2] : 4;
     $pagination = $shortcode_params[3] !== 'false' ? $shortcode_params[3] : '';
     $no_products = $shortcode_params[4] !== 'false' ? $shortcode_params[4] : '';
     $show_products = $shortcode_params[5] !== 'false' ? $shortcode_params[5] : '';
     $use_filter = $shortcode_params[6] !== 'false' ? $shortcode_params[6] : '';
     $action = $shortcode_params[7] !== 'false' ? $shortcode_params[7] : '';
     $bot_margin = $shortcode_params[8] !== 'false' ? $shortcode_params[8] : '';
     $class = $shortcode_params[9] !== 'false' ? $shortcode_params[9] : '';
     $shortcode_id = $shortcode_params[10] !== 'false' ? $shortcode_params[10] : '';
     $disable_overrides = $shortcode_params[11] !== 'false' ? $shortcode_params[11] : '';
     $show_categories = $shortcode_params[12] !== 'false' ? $shortcode_params[12] : '';
     $cat_columns = $shortcode_params[13] !== 'false' ? $shortcode_params[13] : '';
     $res_paged = isset($_POST['pf_paged']) ? $_POST['pf_paged'] : $_POST['pf_page'];
     parse_str($_POST['pf_query'], $qargs);
     $qargs = array_merge($qargs, array('post_type' => 'product', 'post_status' => 'publish'));
     $ajax_query = http_build_query($qargs);
     $current_page = WC_Prdctfltr::prdctfltr_get_between($ajax_query, 'paged=', '&');
     $page = $res_paged;
     $args = str_replace('paged=' . $current_page . '&', 'paged=' . $page . '&', $ajax_query);
     if ($no_products == 'yes') {
         $use_filter = 'no';
         $pagination = 'no';
         $orderby = 'rand';
     }
     $add_ajax = ' data-query="' . $args . '" data-page="' . $res_paged . '" data-shortcode="' . $_POST['pf_shortcode'] . '"';
     $bot_margin = (int) $bot_margin;
     $margin = " style='margin-bottom:" . $bot_margin . "px'";
     if (isset($_POST['pf_filters'])) {
         $curr_filters = $_POST['pf_filters'];
     } else {
         $curr_filters = array();
     }
     $filter_args = '';
     foreach ($curr_filters as $k => $v) {
         if (strpos($v, ',')) {
             $new_v = str_replace(',', '%2C', $v);
         } else {
             if (strpos($v, '+')) {
                 $new_v = str_replace('+', '%2B', $v);
             } else {
                 $new_v = $v;
             }
         }
         $filter_args .= '&' . $k . '=' . $new_v;
     }
     $prdctfltr_global['ajax_query'] = $args;
     $args = $args . $filter_args . '&prdctfltr=active';
     $prdctfltr_global['ajax_paged'] = $res_paged;
     $prdctfltr_global['active_filters'] = $curr_filters;
     if ($action !== '') {
         $prdctfltr_global['action'] = $action;
     }
     if ($preset !== '') {
         $prdctfltr_global['preset'] = $preset;
     }
     if ($disable_overrides !== '') {
         $prdctfltr_global['disable_overrides'] = $disable_overrides;
     }
     $out = '';
     global $woocommerce, $woocommerce_loop, $wp_the_query, $wp_query;
     $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', $columns);
     $prdctfltr_global['ajax'] = true;
     $prdctfltr_global['sc_ajax'] = $_POST['pf_mode'] == 'no' ? 'no' : null;
     $products = new WP_Query($args);
     $products->is_search = false;
     $wp_query = $products;
     $wp_the_query = $products;
     ob_start();
     if ($use_filter == 'yes') {
         include WC_Prdctfltr::$dir . 'woocommerce/loop/product-filter.php';
     }
     if ($products->have_posts()) {
         if ($show_products == 'yes') {
             woocommerce_product_loop_start();
             if (isset($prdctfltr_global['categories_active']) && $prdctfltr_global['categories_active'] === true) {
                 if ($show_categories == 'archive') {
                     if (isset($cat_columns)) {
                         $woocommerce_loop['columns'] = $cat_columns;
                     }
                     woocommerce_product_subcategories();
                 } else {
                     if ($show_categories == 'yes') {
                         if (isset($cat_columns)) {
                             $woocommerce_loop['columns'] = $cat_columns;
                         }
                         self::get_categories();
                     }
                 }
             }
             while ($products->have_posts()) {
                 $products->the_post();
//.........这里部分代码省略.........
开发者ID:hikaram,项目名称:wee,代码行数:101,代码来源:pf-shortcode.php


示例11: woocommerce_content_modified

/**
 * Output WooCommerce content - disbled.
 *
 *
 */
function woocommerce_content_modified()
{
    if (is_singular('product')) {
        while (have_posts()) {
            the_post();
            wc_get_template_part('content', 'single-product');
        }
    } else {
        ?>

        <?php 
        if (apply_filters('woocommerce_show_page_title', true)) {
            ?>

            <h1 class="page-title"><?php 
            woocommerce_page_title();
            ?>
</h1>

        <?php 
        }
        ?>

        <?php 
        do_action('woocommerce_archive_description');
        ?>

        <?php 
        if (have_posts()) {
            ?>

            <?php 
            do_action('woocommerce_before_shop_loop');
            ?>

            <?php 
            woocommerce_product_loop_start();
            ?>

                <?php 
            woocommerce_product_subcategories();
            ?>

                <?php 
            while (have_posts()) {
                the_post();
                ?>

                    <?php 
                wc_get_template_part('content', 'product');
                ?>

                <?php 
            }
            // end of the loop.
            ?>

            <?php 
            woocommerce_product_loop_end();
            ?>

            <?php 
            do_action('woocommerce_after_shop_loop');
            if (function_exists('woocommerce_pagination')) {
                woocommerce_pagination();
            }
            ?>

						<?php 
            $cat_extra_content = get_option("product_cat_" . $curnt_cat_id . "_category_extra_content");
            $extra_content = explode("<!--more-->", $cat_extra_content);
            if (!empty($extra_content[1])) {
                echo "<article>" . $extra_content[0] . " <a class='more-link'>Read More</a><div class='more-content'>" . $extra_content[1] . "</div></article>";
            } else {
                echo "<article>" . $extra_content[0] . "</article>";
            }
            ?>

        <?php 
        } elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
            ?>

            <?php 
            wc_get_template('loop/no-products-found.php');
            ?>

        <?php 
        }
    }
}
开发者ID:vjdesign,项目名称:fontaine,代码行数:95,代码来源:woocommerces.php


示例12: my_account

        function my_account()
        {
            global $product;
            $funds = $this->get_account_funds();
            $args = array('post_type' => 'product', 'meta_query' => array(array('key' => '_is_deposit', 'value' => 'yes')));
            query_posts($args);
            echo '<h2>' . __('Account Funds', 'wc_account_funds') . '</h2>';
            echo '<p>' . sprintf(__('You currently have <b>%s</b> in your account.', 'wc_account_funds'), $funds) . '</p>';
            if (have_posts()) {
                do_action('woocommerce_before_shop_loop');
                ?>
                <ul class="products">
                    <?php 
                woocommerce_product_subcategories();
                ?>
                    <?php 
                while (have_posts()) {
                    the_post();
                    ?>
                        <?php 
                    woocommerce_get_template_part('content', 'product');
                    ?>
                    <?php 
                }
                // end of the loop.
                // Reset Post Data
                wp_reset_query();
                ?>
                </ul>

            <?php 
                do_action('woocommerce_after_shop_loop');
            }
            $this->my_account_orders();
        }
开发者ID:bulbulbigboss,项目名称:bigboss-woocommerce-deposit-funds,代码行数:35,代码来源:bigbosswoocommerce-deposit-funds.php


示例13: get_products

 public static function get_products($products)
 {
     global $prdctfltr_global, $woocommerce_loop;
     $opt = self::$settings['opt'];
     $offset = intval($opt['pf_offset']);
     //$id = isset( $prdctfltr_global['unique_id'] ) ? $prdctfltr_global['unique_id'] : $prdctfltr_global['true_id'];
     if (isset($prdctfltr_global['unique_id']) && isset($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts'])) {
         extract($prdctfltr_global['pagefilters'][$prdctfltr_global['unique_id']]['atts']);
     } else {
         $show_categories = 'archive';
         $cat_columns = '';
         $show_products = 'yes';
     }
     if ($show_products == 'no') {
         return;
     }
     ob_start();
     self::$settings['instance'] = $products;
     if ($products->have_posts()) {
         woocommerce_product_loop_start();
         if (isset($prdctfltr_global['categories_active']) && $prdctfltr_global['categories_active'] === true) {
             if ($show_categories == 'archive') {
                 if (isset($cat_columns)) {
                     $woocommerce_loop['columns'] = $cat_columns;
                 }
                 woocommerce_product_subcategories();
             } else {
                 if ($show_categories == 'yes') {
                     if (isset($cat_columns)) {
                         $woocommerce_loop['columns'] = $cat_columns;
                     }
                     self::get_categories();
                 }
             }
         }
         $woocommerce_loop['columns'] = self::$settings['columns'];
         if ($offset > 0) {
             $curr_offset = $offset / $woocommerce_loop['columns'];
             $decimal = $curr_offset - (int) $curr_offset;
             if ($decimal > 0) {
                 $woocommerce_loop['loop'] = $decimal * $woocommerce_loop['columns'];
             } else {
                 $woocommerce_loop['loop'] = 0;
             }
         }
         while ($products->have_posts()) {
             $products->the_post();
             wc_get_template_part('content', 'product');
         }
         woocommerce_product_loop_end();
     } else {
         include WC_Prdctfltr::$dir . 'woocommerce/loop/no-products-found.php';
     }
     return ob_get_clean();
 }
开发者ID:arobbins,项目名称:spellestate,代码行数:55,代码来源:pf-shortcode.php


示例14: woocommerce_default_index_loop

function woocommerce_default_index_loop()
{
    if (have_posts()) {
        ?>
		    <?php 
        if (!function_exists('the_ddlayout')) {
            do_action('woocommerce_before_shop_loop');
        }
        ?>
			
			<?php 
        woocommerce_product_loop_start();
        ?>

				<?php 
        woocommerce_product_subcategories();
        ?>

				<?php 
        while (have_posts()) {
            the_post();
            ?>

					<?php 
            wc_get_template_part('content', 'product');
            ?>

				<?php 
        }
        // end of the loop.
        ?>

			<?php 
        woocommerce_product_loop_end();
        ?>

			<?php 
        /**
         * woocommerce_after_shop_loop hook
         *
         * @hooked woocommerce_pagination - 10
         */
        if (!function_exists('the_ddlayout')) {
            do_action('woocommerce_after_shop_loop');
        }
        ?>
			
		<?php 
    } elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
        ?>

			<?php 
        wc_get_template('loop/no-products-found.php');
        ?>

		<?php 
    }
    if (!function_exists('the_ddlayout')) {
        /**
         * woocommerce_after_main_content hook
         *
         * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
         */
        do_action('woocommerce_after_main_content');
    }
}
开发者ID:rebeccayshen,项目名称:kitlist,代码行数:66,代码来源:archive-product.php


示例15: woocommerce_content

			/**
			* Output WooCommerce content.
			*
			* This function is only used in the optional 'woocommerce.php' template
			* which people can add to their themes to add basic woocommerce support
			* without using hooks or modifying core templates.
			*
			* @access public
			* @return void
			*
			* WM: OVERRIDE
			* Just removed H1 tag
			*/
			function woocommerce_content() {

				if ( is_singular( 'product' ) ) {

					while ( have_posts() ) : the_post();

						woocommerce_get_template_part( 'content', 'single-product' );

					endwhile;

				} else {

					//Just removed H1 tag

					do_action( 'woocommerce_archive_description' ); ?>

					<?php if ( have_posts() ) : ?>

						<?php do_action('woocommerce_before_shop_loop'); ?>

						<?php woocommerce_product_loop_start(); ?>

							<?php woocommerce_product_subcategories(); ?>

							<?php while ( have_posts() ) : the_post(); ?>

								<?php woocommerce_get_template_part( 'content', 'product' ); ?>

							<?php endwhile; // end of the loop. ?>

						<?php woocommerce_product_loop_end(); ?>

						<?php do_action('woocommerce_after_shop_loop'); ?>

					<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>

						<?php woocommerce_get_template( 'loop/no-products-found.php' ); ?>

					<?php endif;

				}
			} // /woocommerce_content
开发者ID:unisexx,项目名称:drtooth,代码行数:55,代码来源:setup.php


示例16: shop

 /**
  * This function creates the html code necessary for a woocommerce shop section. It uses the woocommerce shop loop to do that
  *
  * @param array $element is an array with all the data necessary for creating the html code (it contains the element data and the saved values for the element)
  * @return string $output the string returned contains the html code generated within the method
  */
 function shop($element)
 {
     $output = "";
     //check if the plugin is enabled
     if (!avia_woocommerce_enabled()) {
         $url = network_site_url('wp-admin/plugin-install.php?tab=search&type=term&s=WooCommerce&plugin-search-input=Search+Plugins');
         $output = "<p><strong>You need to install and activate the <a href='{$url}'>WooCommerce Shop Plugin</a> to display Products</strong></p>";
         return $output;
     }
     extract($element['saved_value'][0]);
     global $avia_config, $more, $woocommerce_loop;
     if ($shop_columns == 5 && strpos($avia_config['layout'], 'dual') !== false) {
         $shop_columns = 4;
     }
     if ($shop_text == 'yes') {
         $avia_config['shop_overview_excerpt'] = 'active';
     }
     $woocommerce_loop['columns'] = $avia_config['shop_overview_column'] = $shop_columns;
     $order = get_option('woocommerce_default_catalog_orderby');
     if (!$order) {
         $order = "menu_order";
     }
     $avia_config['new_query'] = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, "paged" => get_query_var('paged'), 'posts_per_page' => $shop_item_count, 'orderby' => $order, 'order' => 'desc', 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')));
     if (empty($shop_cats_dynamic) || $shop_cats_dynamic == 'null') {
         $avia_config['new_query']['post_type'] = "product";
     } else {
         $avia_config['new_query']['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => explode(',', $shop_cats_dynamic), 'operator' => 'IN'));
     }
     query_posts($avia_config['new_query']);
     ob_start();
     if (have_posts()) {
         do_action('woocommerce_before_shop_loop');
         echo '<ul class="products">';
         woocommerce_product_subcategories();
         while (have_posts()) {
             the_post();
             woocommerce_get_template_part('content', 'product');
         }
         // end of the loop.
         echo '</ul>';
         do_action('woocommerce_after_shop_loop');
     } else {
         if (!woocommerce_product_subcategories(array('before' => '<ul class="products">', 'after' => '</ul>'))) {
             echo "<p>" . __('No products found which match your selection.', 'woocommerce') . "</p>";
         }
     }
     echo '<div class="clear"></div>';
     $products = ob_get_clean();
     $output .= "<div class='container_wrap " . $avia_config['layout'] . " template-shop shop_columns_" . $avia_config['shop_overview_column'] . "'>";
     $output .= "<div class='template-shop content shop_slider_{$shop_slider}' data-interval='{$shop_autorotate}'>";
     $output .= $products;
     if ($shop_pagination == 'yes') {
         $output .= avia_pagination();
     }
     $output .= "</div>";
     $output .= "</div>";
     wp_reset_query();
     return $output;
 }
开发者ID:eddiewilson,项目名称:new-ke,代码行数:65,代码来源:helper-templates.php


示例17: if

?>

<?php if ( have_posts() ) : ?>

	<?php do_action('woocommerce_before_shop_loop'); ?>

	<div class="products">

		<?php woocommerce_product_subcategories(); ?>

		<?php while ( have_posts() ) : the_post(); ?>

			<?php woocommerce_get_template_part( 'content', 'product' ); ?>

		<?php endwhile; // end of the loop. ?>

	</div>

	<?php do_action('woocommerce_after_shop_loop'); ?>

<?php else : ?>

	<?php if ( ! woocommerce_product_subcategories( array( 'before' => '<div class="products">', 'after' => '</div>' ) ) ) : ?>

		<p><?php _e( 'No products found which match your selection.', 'woocommerce' ); ?></p>

	<?php endif; ?>

<?php endif; ?>

<div class="clear"></div>
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:31,代码来源:loop-shop.php


示例18: html

 public function html()
 {
     global $woocommerce, $woocommerce_loop;
     $output = "";
     global $avia_config;
     $output = "";
     avia_post_slider::$slide++;
     extract($this->atts);
     $extraClass = 'first';
     $grid = 'one_third';
     $image_size = 'portfolio';
     $post_loop_count = 1;
     $loop_counter = 1;
     $autoplay = $autoplay == "no" ? false : true;
     $total = $columns % 2 ? "odd" : "even";
     $woocommerce_loop['columns'] = $columns;
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             $image_size = 'large';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             $image_size = 'portfolio_small';
             break;
         case "5":
             $grid = 'av_one_fifth';
             $image_size = 'portfolio_small';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'hoverpause' => 1));
     ob_start();
     if (have_posts()) {
         echo "<div {$data} class='template-shop avia-content-slider avia-content-{$type}-active avia-content-slider" . avia_post_slider::$slide . " avia-content-slider-{$total} {$class} shop_columns_{$columns}' >";
         if ($sort == "dropdown") {
             avia_woocommerce_frontend_search_params();
         }
         echo "<div class='avia-content-slider-inner'>";
         if ($type == 'grid') {
             echo '<ul class="products">';
         }
         while (have_posts()) {
             the_post();
             if ($loop_counter == 1 && $type == 'slider') {
                 echo '<ul class="products slide-entry-wrap">';
             }
             woocommerce_get_template_part('content', 'product');
             $loop_counter++;
             $post_loop_count++;
             if ($loop_counter > $columns) {
                 $loop_counter = 1;
             }
             if ($loop_counter == 1 && $type == 'slider') {
                 echo '</ul>';
             }
         }
         // end of the loop.
         if ($loop_counter != 1 || $type == 'grid') {
             echo '</ul>';
         }
         echo "</div>";
         if ($post_loop_count - 1 > $columns && $type == 'slider') {
             echo $this->slide_navigation_arrows();
         }
         echo "</div>";
     } else {
         if (!woocommerce_product_subcategories(array('before' => '<ul class="products">', 'after' => '</ul>'))) {
             echo "<p>" . __('No products found which match your selection.', 'woocommerce') . "</p>";
         }
     }
     echo '<div class="clear"></div>';
     $products = ob_get_clean();
     $output .= $products;
     if ($paginate == "yes" && ($avia_pagination = avia_pagination('', 'nav'))) {
         $output .= "<div class='pagination-wrap pagination-slider'>{$avia_pagination}</div>";
     }
     wp_reset_query();
     return $output;
 }
开发者ID:DylanPeti,项目名称:socialize,代码行数:85,代码来源:productslider.php


示例19: tb_listener


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woocommerce_products_will_display函数代码示例发布时间:2022-05-23
下一篇:
PHP woocommerce_product_loop_start函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap