changed category listing url and added ids to category output
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 21 Dec 2015 21:15:24 +0000 (16:15 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 21 Dec 2015 21:15:24 +0000 (16:15 -0500)
index.php
views/list_categories.php
views/list_products.php

index 016136b..b2fa397 100644 (file)
--- a/index.php
+++ b/index.php
@@ -354,7 +354,7 @@ function michsci_shortcode($atts)
         //michsci_list_categories($cat_id);
     } else if ( !$catid_id && !$product_id ) {
         michsci_list_products();
-        //michsci_list_categories();
+        michsci_list_categories();
     }
 
     $output = ob_get_contents();
@@ -475,7 +475,7 @@ function michsci_list_categories( $cat_id = null )
 
     $taxonomy = MICHSCI_CATEGORY_NAME;
     $args = array(
-        'hide_empty' => true,
+        'hide_empty' => false,
         'pad_counts' => true
     );
     if ( $cat_id ) {
@@ -495,9 +495,9 @@ function michsci_list_categories( $cat_id = null )
         if ( $iterator == $totalTerms) {
             $term->end = true;
         }
-        $term->href $current_url
-            . ( ( strpos( $current_url, '?' ) ) ? '&' : '?' )
-            . "category=" . $term->term_id;
+        $term->href .= //$current_url
+//             ( ( strpos( $current_url, '?' ) ) ? '&' : '?' )
+            "?michsci_category=" . $term->term_id;
         ++$iterator;
     }
 
index 3451119..e54fb0e 100644 (file)
@@ -1,16 +1,18 @@
-
-<div class="row">
+<div id="categoriesView" class="row">
 
 <?php
     if ( isset( $taxonomy_terms) && is_array( $taxonomy_terms ) ) :
         foreach ( $taxonomy_terms  as $term ) : ?>
+    <?php if (function_exists('z_taxonomy_image')) z_taxonomy_image(); ?>
     <pre><?php  //echo print_r( $term, true ) ?></pre>
-        <div class="small-12 medium-3 columns<?php if ($term->end){ echo ' end';}?>">
-            <div class="row">
-                <div class="small-12 columns"><a href="<?php echo $term->href; ?>">
+     <div class="row">
+        <div class="small-12 columns<?php if ($term->end){ echo ' end';}?>">
+          
+         <div id="catContainer" class= "small-12 medium-6 columns"><a href="<?php echo $term->href; ?>">
+                          <img width="343" height="127" src="<?php echo z_taxonomy_image_url($term->term_id, 'thumbnail'); ?>" class="image wp-post-image no-display" alt="<?php echo $term->name; ?>" title="<?php echo $term->name; ?>" itemprop="image">
             <?php echo $term->description ?></a>
                 </div>
-                <div class="small-12 text-center columns">
+                <div class="small-12 medium-6 text-center columns">
             <a href="<?php echo $term->href; ?>"> <?php echo $term->name; ?> </a>
                 </div>
             </div>
index 808d7b4..9e4fcbd 100644 (file)
@@ -1,5 +1,5 @@
 <?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
-    <div class="row">
+    <div id="productsView" 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';}?>">