Last active
January 1, 2016 05:08
-
-
Save ejntaylor/8096034 to your computer and use it in GitHub Desktop.
List Categories within tag ** Need to replace Catgeory shortcode with another loop which filters products out which are not in current product_tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php $product_tag = (get_query_var('product_tag')) ? get_query_var('product_tag') : 1; ?> | |
| <h1>Currently Browsing: <?php echo $product_tag; ?></h1> | |
| <?php | |
| $args = array( | |
| 'number' => $number, | |
| 'orderby' => $orderby, | |
| 'order' => $order, | |
| 'hide_empty' => $hide_empty, | |
| 'include' => $ids | |
| ); | |
| $product_categories = get_terms( 'product_cat', $args ); | |
| echo '<ul class="tag-cat">'; | |
| foreach( $product_categories as $cat ) { | |
| $tag_cat = do_shortcode('[product_category category="'. $cat->slug .'" per_page="30" columns="8" orderby="date" order="desc"]'); | |
| if(($tag_cat != '<div class="woocommerce"></div>')) { | |
| echo '<li class="tag-group">'; | |
| echo '<ul class="tagged">'; | |
| echo '<h2>'; | |
| echo $cat->name; | |
| echo '</h2>'; | |
| echo $tag_cat; | |
| echo '</ul>'; | |
| echo '</li>'; | |
| } | |
| } | |
| echo '</ul>'; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment