当前位置: 首页>>代码示例>>PHP>>正文


PHP woocommerce_product_subcategories函数代码示例

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


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


注:本文中的woocommerce_product_subcategories函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。