--- /dev/null
+<h2>Event Dates:</h2>
+
+<?php $args = array(
+ 'number' => $number,
+ 'orderby' => 'title',
+ 'order' => 'ASC',
+ 'hide_empty' => $hide_empty,
+ 'include' => $ids
+ );
+ $product_categories = get_terms( 'product_cat', $args );
+ $count = count($product_categories);
+ if ( $count > 0 ){
+ foreach ( $product_categories as $product_category ) {
+ $args = array(
+ 'posts_per_page' => -1,
+ 'tax_query' => array(
+ 'relation' => 'AND',
+ array(
+ 'taxonomy' => 'product_cat',
+ 'field' => 'slug',
+ // 'terms' => 'white-wines'
+ 'terms' => $product_category->slug
+ )
+ ),
+ 'post_type' => 'product',
+ 'orderby' => 'title,'
+ );
+ $products = new WP_Query( $args );
+ if ($products->have_posts()) { ?>
+ <div class="side-product-wrapper">
+ <div class="side-product-container" data-equalizer-watch>
+ <div class="side-product-content-container">
+ <?php
+ echo '<h5><a href="' . get_term_link( $product_category ) . '">' . $product_category->name . '</a></h5>';
+ echo "<ul>";
+
+ while ( $products->have_posts() ) {
+
+ $products->the_post();
+ ?>
+ <li>
+ <a href="<?php the_permalink(); ?>">
+ <?php the_title(); ?>
+ </a>
+ </li>
+ <?php
+ }
+ if ($no_products) {
+ echo "TBD";
+ }
+ echo "</ul>";?>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+ <?php } ?>
+ <?php } ?>
\ No newline at end of file
-
- <div class="sidebar shop-sidebar">
+<div id="side-divide" class="medium-3 columns show-for-medium">
+</div>
+<div>
+ <?php echo get_template_part("parts/cats-and-products"); ?>
+</div>
+
+
+<div class="sidebar shop-sidebar">
<!-- <h1>Test</h1>-->
- <?php
+ <?php
//
- $taxonomy = 'product_cat';
- $orderby = 'name';
- $show_count = 0; // 1 for yes, 0 for no
- $pad_counts = 0; // 1 for yes, 0 for no
- $hierarchical = 1; // 1 for yes, 0 for no
- $title = '';
- $empty = 0;
+ $taxonomy = 'product_cat';
+ $orderby = 'name';
+ $show_count = 0; // 1 for yes, 0 for no
+ $pad_counts = 0; // 1 for yes, 0 for no
+ $hierarchical = 1; // 1 for yes, 0 for no
+ $title = '';
+ $empty = 0;
+
+ $args = array(
+ 'taxonomy' => $taxonomy,
+ 'orderby' => $orderby,
+ 'show_count' => $show_count,
+ 'pad_counts' => $pad_counts,
+ 'hierarchical' => $hierarchical,
+ 'title_li' => $title,
+ 'hide_empty' => $empty
+ );
+ $all_categories = get_categories( $args );
+ foreach ($all_categories as $cat) {
+ if($cat->category_parent == 0) {
+ $category_id = $cat->term_id;
+ echo '<br /><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
- $args = array(
- 'taxonomy' => $taxonomy,
- 'orderby' => $orderby,
- 'show_count' => $show_count,
- 'pad_counts' => $pad_counts,
- 'hierarchical' => $hierarchical,
- 'title_li' => $title,
- 'hide_empty' => $empty
- );
- $all_categories = get_categories( $args );
- foreach ($all_categories as $cat) {
- if($cat->category_parent == 0) {
- $category_id = $cat->term_id;
- echo '<br /><a href="'. get_term_link($cat->slug, 'product_cat') .'">'. $cat->name .'</a>';
+ $args2 = array(
+ 'taxonomy' => $taxonomy,
+ 'child_of' => 0,
+ 'parent' => $category_id,
+ 'orderby' => $orderby,
+ 'show_count' => $show_count,
+ 'pad_counts' => $pad_counts,
+ 'hierarchical' => $hierarchical,
+ 'title_li' => $title,
+ 'hide_empty' => $empty
+ );
+ $sub_cats = get_categories( $args2 );
+ if($sub_cats) {
+ foreach($sub_cats as $sub_category) {
+ echo $sub_category->name ;
+ }
+ }
+ }
+ }
+ ?>
- $args2 = array(
- 'taxonomy' => $taxonomy,
- 'child_of' => 0,
- 'parent' => $category_id,
- 'orderby' => $orderby,
- 'show_count' => $show_count,
- 'pad_counts' => $pad_counts,
- 'hierarchical' => $hierarchical,
- 'title_li' => $title,
- 'hide_empty' => $empty
- );
- $sub_cats = get_categories( $args2 );
- if($sub_cats) {
- foreach($sub_cats as $sub_category) {
- echo $sub_category->name ;
- }
- }
- }
- }
- ?>
-
- <a href="<?php echo esc_url( get_permalink( woocommerce_get_page_id( 'shop' ) ) ); ?>">
- <h1>Products</h1>
- </a>
+ <a href="<?php echo esc_url( get_permalink( woocommerce_get_page_id( 'shop' ) ) ); ?>">
+ <h1>Products</h1>
+ </a>
<!-- Adding parent_id="0" to the shortcode attributes below places it back the way it was, just showing top-level cats -->
- <?php echo do_shortcode('[product_categories number="" hierarchical="1" orderby="name" order="asc" columns="1" hide_empty="0" ids=""]'); ?>
- </div>
+ <?php echo do_shortcode('[product_categories number="" hierarchical="1" orderby="name" order="asc" columns="1" hide_empty="0" ids=""]'); ?>
+</div>
<script>
jQuery(document).ready(function($) {