if ( isset($atts['cat']) ) {
if ($prodCategory = get_term_by( 'slug', $atts['cat'], MICHSCI_CATEGORY_NAME ) ) {
+ if(!isset($_REQUEST[MICHSCI_CATEGORY_NAME])){
$_REQUEST[MICHSCI_CATEGORY_NAME] = $prodCategory->term_id;
- $cat_id = $_REQUEST[MICHSCI_CATEGORY_NAME];
-
+ }
+ $cat_id = $prodCategory->term_id;
}
}
echo '<form id="catSubmit" action=""><div class="row catSearch"><div id="viewBtns" class="12-small medium-3 columns"> <button id="grid" type="button">Grid</button> <button id="list"type="button">list</button>
function michsci_list_products()
{
global $wpdb, $wp;
+ $cat = get_term($cat_id, MICHSCI_CATEGORY_NAME);
$args = array(
'posts_per_page' => -1,
'post_type' => 'miproduct'
-
-
<?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
<div id="gridView" class="row">
<?php
-
+ // sub cats
$catNum = $_REQUEST[MICHSCI_CATEGORY_NAME];
echo category_description($catNum);
-
- ?>
- <?php $cat_id = $_REQUEST[MICHSCI_CATEGORY_NAME];
- $cat_children = get_term_children($cat_id, MICHSCI_CATEGORY_NAME);
+ $cat_id = $_REQUEST[MICHSCI_CATEGORY_NAME];
+ $cat_children = get_term_children($cat_id, MICHSCI_CATEGORY_NAME);
foreach($cat_children as $cats){
- $term = get_term($cats, MICHSCI_CATEGORY_NAME);
- echo $term->name;
- }
+ $term = get_term($cats, MICHSCI_CATEGORY_NAME); ?>
+ <?php $tags = wp_get_post_terms($product->ID,'michsci_tag'); ?>
+ <div class="<?php echo $term->slug;?> product grid small-12 medium-4 columns<?php if ($product->end){ echo ' end';}?>">
+ <div class="prodImgGrid small-12 columns"><a href="<?php echo $product->href; ?>">
+ <img id="catImg" src="<?php echo z_taxonomy_image_url($cats, array(320, 285)); ?>" class="image wp-post-image no-display" alt="<?php echo $term->name; ?>" title="<?php echo $term->name; ?>" itemprop="image">
+ </div>
+ <div class="subCatGrid small-12 columns">
+ <a href="<?php echo $product->href; ?>"><?php echo $term->name; ?></a>
+ </div>
+ <div class="prodTitleGrid small-12 columns">
+ <a href="<?php echo $product->href; ?>"><strong><?php echo $term->name; ?></strong></a>
+ </div>
+ </div>
+
+ <?php // end sub cats
+ }
?>
<?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
<?php $tags = wp_get_post_terms($product->ID,'michsci_tag'); ?>
<div class="<?php foreach ($tags as $tag)echo $tag->slug . " ";?> product grid small-12 medium-4 columns<?php if ($product->end){ echo ' end';}?>">
-
<div class="prodImgGrid small-12 columns"><a href="<?php echo $product->href; ?>">
<?php echo get_the_post_thumbnail( $product->ID, array(320, 285)); ?></a>
</div>