WooCommerce [product_categories number=""]
-
Hello everyone,
I am having problems with WooCommerce, and their support forum has been down for the passed 2 days. Basically, they have shortcodes in the shortcode button in the page editor that is not documented in their docs, and it is not working. I want to create a page with all categories on it, and there is a shortcode [product_categories number=””] that looks like it should do that, but alas it is not working.
I looked in the shortcode PHP file and found the following:
/** * List all (or limited) product categories **/ function woocommerce_product_categories( $atts ) { global $woocommerce_loop; extract( shortcode_atts( array ( 'number' => null, 'orderby' => 'name', 'order' => 'ASC', 'columns' => '4', 'hide_empty' => 1 ), $atts ) ); if ( isset( $atts[ 'ids' ] ) ) { $ids = explode( ',', $atts[ 'ids' ] ); $ids = array_map( 'trim', $ids ); } else { $ids = array(); } $hide_empty = ( $hide_empty == true || $hide_empty == 1 ) ? 1 : 0; $args = array( 'number' => $number, 'orderby' => $orderby, 'order' => $order, 'hide_empty' => $hide_empty, 'include' => $ids ); $terms = get_terms( 'product_cat', $args ); $woocommerce_loop['columns'] = $columns; ob_start(); if ( $product_categories ) { echo '<ul class="products">'; foreach ( $product_categories as $category ) { woocommerce_get_template( 'content-product_cat.php', array( 'category' => $category ) ); } echo '</ul>'; } wp_reset_query(); return ob_get_clean(); }
Any thoughts?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WooCommerce [product_categories number=""]’ is closed to new replies.