Added top level checkbox filter
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 28 Dec 2015 17:55:06 +0000 (12:55 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 28 Dec 2015 17:55:06 +0000 (12:55 -0500)
js/app.js
js/custom/upcp.js
page.php
parts/sidebar-l.php

index 05a95df..93d434c 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -75,5 +75,10 @@ $(document).ready(function () {
         return $(this).css('clear') == 'both';
     }).remove();
 
-
+    $("#tagBox :checkbox").click(function() {
+        $(".product").hide();
+        $("#tagBox :checkbox:checked").each(function() {
+            $("." + $(this).val()).show();
+        });
+    });
 });
index aaaa512..580bb85 100644 (file)
@@ -55,5 +55,10 @@ $(document).ready(function () {
         return $(this).css('clear') == 'both';
     }).remove();
 
-
+    $("#tagBox :checkbox").click(function() {
+        $(".product").hide();
+        $("#tagBox :checkbox:checked").each(function() {
+            $("." + $(this).val()).show();
+        });
+    });
 });
index 41cd904..a76cbc6 100644 (file)
--- a/page.php
+++ b/page.php
    <div id="main-content" class="small-12 columns">   
                                  
                         <?php if(have_posts()) : while(have_posts()): the_post();?>
+      
                         <?php the_content();?>
                         <?php endwhile; else:?>
                         <p><?php _e('Sorry, no results found.');?></p>
-                   
+                
                         <?php endif;?>
                     <?php get_template_part('parts/sidebar-l'); ?>  
                 </div>
index 4603da4..9af51fb 100644 (file)
@@ -5,13 +5,16 @@
               <h2> Tags </h2>
            <?php 
             $args = array(
-                "hide_empty"=> false
+                "hide_empty"=> false,
+                "hierarchical"=>true,
+                "parent"=>0
             );
-            $tags = get_terms("michsci_tag", $args);
-            foreach($tags as $tag){
-                echo '<input class="tagOptions" type="checkbox" name="' . $tag->name . '" value="' . $tag->name . '"' . '>' . " " . $tag->name . "<br>";
+            $tags = get_terms("michsci_category", $args);
+           
+              foreach($tags as $tag){
+                echo '<input class="tagOptions" type="checkbox" name="' . $tag->name . '" value="' . $tag->slug . '"' . '>' . " " . $tag->name . "<br>";
             } ?>
-                <input class="submit blogbutton" type="submit" name="submit" value="Search" />
+               
                 <input type="hidden" name="searchType" value="blog" /> </div>
         </form>