added slug names to classes for checkbox filtering
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 28 Dec 2015 18:10:52 +0000 (13:10 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 28 Dec 2015 18:10:52 +0000 (13:10 -0500)
index.php
views/list_products.php
views/product_detail.php

index f765e28..59a82bc 100644 (file)
--- a/index.php
+++ b/index.php
@@ -646,3 +646,4 @@ function michsci_show_category($cat_id)
 }
 add_shortcode( 'michproducts', 'michsci_shortcode' );
 
+
index 1f5ee83..197b8b4 100644 (file)
@@ -1,9 +1,12 @@
+
+
 <?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
 
     <div id="gridView" class="row">
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
-   
-        <div class="product grid small-12 medium-4 columns<?php if ($product->end){ echo ' end';}?>">
+        
+   <?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>
     <?php endforeach; endif; ?>
-        </div>
+    </div>
 <?php } ?>
 
 <?php if($_COOKIE['view'] == "list"){ ?>
    <div id="listView" class="row">
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
 <!--    <div class="row view">-->
- <div class="product list small-12 columns<?php if ($product->end){ echo ' end';}?>">
+<?php $tags = wp_get_post_terms($product->ID,'michsci_tag'); ?>
+ <div class="<?php foreach ($tags as $tag)echo $tag->slug . " ";?>product list small-12 columns<?php if ($product->end){ echo ' end';}?>">
            
                 <div class="prodImgList small-12 large-3 columns"><a href="<?php echo $product->href; ?>">
             <?php echo get_the_post_thumbnail( $product->ID, 'post-thumbnail'); ?></a>
index 6091c69..c3cd049 100644 (file)
@@ -9,7 +9,19 @@ $relatives = wp_get_post_terms($product->ID, 'michsci_category', $args);
     
     echo '<a href="'.  '?michsci_category=' . $relative->term_id . '" >' . $relative->name . "</a>" . " > ";
 } ?>
-<?php echo $product->post_title; ?>
+
+<?php echo $product->post_title . "<br>"; ?>
+
+<?php 
+echo "Tags: ";
+$args = array(
+    "hide_empty"=>false
+);
+$tags = wp_get_post_terms($product->ID,'michsci_tag', $args);
+foreach ($tags as $tag){
+    
+    echo  $tag->name;
+}?>
 <h2><?php echo $product->post_title; ?></h2>
     <?php
     setup_postdata( $product );