added category description to category view
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 12 Jan 2016 15:00:27 +0000 (10:00 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 12 Jan 2016 15:00:27 +0000 (10:00 -0500)
views/list_categories.php
views/list_products.php

index 399ff45..0971b44 100644 (file)
@@ -1,16 +1,22 @@
 <?php if(!isset($_COOKIE['catView']) || $_COOKIE['catView'] == "grid"){ ?>
 <div id="categoriesGridView" class="row">
+    <?php $uri= $_SERVER['REQUEST_URI']; 
+      $catNum = substr($uri, -2);
+      if(is_numeric($catNum) == false){
+          $catNum = substr($catNum, -1);
+      }
+      echo category_description($catNum);
+   ?>
 <?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-4 columns<?php if ($term->end){ echo ' end';}?>">
           <div class="row">
          <div id="catContainer" class= "small-12 columns"><a href="<?php echo $term->href; ?>">
                           <img id="catImg" src="<?php echo z_taxonomy_image_url($term->term_id, array(320, 285)); ?>" 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 id="catTitleGrid" class="small-12 columns">
                  <a href="<?php echo $term->href; ?>"> <?php echo $term->name; ?> </a>
              </div>
     <?php
         endforeach;
     endif; ?>
-
 </div>
 <?php } ?>
 <?php if(!isset($_COOKIE['catView']) || $_COOKIE['catView'] == "list"){ ?>
 <div id="categoriesListView" class="row">
+     <?php $uri= $_SERVER['REQUEST_URI']; 
+      $catNum = substr($uri, -2);
+      if(is_numeric($catNum) == false){
+          $catNum = substr($catNum, -1);
+      }
+      echo category_description($catNum);
+   ?>
 <?php
     if ( isset( $taxonomy_terms) && is_array( $taxonomy_terms ) ) :
         foreach ( $taxonomy_terms  as $term ) : ?>
@@ -38,7 +50,7 @@
             <div id="catImgContainer" class="small-12 medium-4 columns">
                <img id="catImg" 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">
             </div>
-            <?php echo $term->description ?></a>
+          
              <div id="catTitleList" class="small-12 medium-4 columns">
                 <a href="<?php echo $term->href; ?>"> <?php echo $term->name; ?> </a>
              </div>
index 197b8b4..2f4819e 100644 (file)
@@ -1,7 +1,6 @@
 
 
 <?php if(!isset($_COOKIE['view']) || $_COOKIE['view'] == "grid"){ ?>
-
     <div id="gridView" class="row">
     <?php if ( isset( $products ) && is_array( $products ) ) : foreach ( $products as $product ) : ?>
         
@@ -39,8 +38,6 @@
                 <div class="subCatList small-12 large-3 columns">
                     <a href="<?php echo $product->href; ?>"><?php echo $product->term; ?></a>
                 </div>
-                
-          
        </div>
 <!--        </div>-->
     <?php endforeach; endif; ?>