Ok, I was able to get it to work and filter, except there are a few more things I have to work out to get it working the way I want. As far as the functionality of it though, I did manage to get it to work. In case anyone else is interested - here's what I did
First I went through my themes functions.php and my header to make sure the latest jquery was included and the correct scripts included, I also made sure it wasn't included multiple times and they were in the right order (jquery script first then isotope script.)
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'></script> <script type='text/javascript' src='<?php bloginfo('template_directory'); ?>/lib/jquery.isotope.min.js'></script>
Next I made sure the CSS for isotope was in my style sheet.
.isotope-item { z-index: 2; } .isotope-hidden.isotope-item { pointer-events: none; z-index: 1; } .isotope, .isotope .isotope-item { /* change duration value to whatever you like */ -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; transition-duration: 0.8s; } .isotope { -webkit-transition-property: height, width; -moz-transition-property: height, width; transition-property: height, width; } .isotope .isotope-item { -webkit-transition-property: -webkit-transform, opacity; -moz-transition-property: -moz-transform, opacity; transition-property: transform, opacity; }
After that I edited the code in my functions for the filter list ( you can see the original in my question )
function isotope_categories() { $terms = get_terms('videoscategory'); $html = '<ul id="options">'; $html .= '<li><a href="#" data-option-value="*" data-filter="*" class="selected">All items</a></li>'; foreach ($terms as $term) { $html .= "<li><a href='#' data-filter='.{$term->slug}' class='current'>{$term->name}</a></li>"; } $html .= '</ul>'; echo $html; }
Next I altered my coding for my loop -
<div id="content" style="width: 94%;"> <div id="isocontent"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php $terms = get_the_terms( $post->ID, 'videoscategory' ); ?> <div class="box<?php foreach( $terms as $term ) echo ' ' . $term->slug; ?>" style="width:100%; float:left; border-top:1px solid #ccc; margin-top:10px;"> //MY DIVS AND CONTENT </div> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> <div style="position:absolute;"> <?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages); } ?> </div></div></div>
Then I edited the javascript code under it -
<script type="text/javascript"> $(document).ready(function(){ var mycontainer = $('#isocontent'); mycontainer.isotope({ itemSelector: '.box' }); // filter items when filter link is clicked $('#options a').click(function(){ var selector = jQuery(this).attr('data-filter'); mycontainer.isotope({ filter: selector }); return false; }); }); </script>
After doing all this, I was finally able to get isotope to work. I still have some things to fix so that I can get it to work exactly how I want it but as far as getting it to function properly, this is what worked for me.