Ok, I was able to get the drop down working. I was not able figure out my second question though-
How to populate the drop down with the terms/child terms of the
current category being viewed?
Here’s how I got the drop down to work – The drop down —
<?php
$terms = get_terms("videoscategory");
$count = count($terms);
if ( $count > 0 ){
echo "<select id='filter-select'>";
echo "<option value="*" data-filter-value="" class="selected">All items</option>";
foreach ( $terms as $term ) {
echo "<option value=".{$term->slug}">" . $term->name . "</option>";
}
echo "</select>";
}
?>
<div id="filters">
<select id="filter-select2">
<option value="*" data-filter="*" class="selected">All items</option>
<option value=".product" class="current">Documents</option>
<option value=".videos" class="current">Videos</option>
<option value=".text" class="current">Text</option>
<option value=".link" class="current">Links</option>
</select>
</div>
<div id="isocontent">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $terms = get_the_terms( $post->ID, 'videoscategory' ); ?>
<?php $post_type = get_post_type($post->ID); ?>
<div class="box<?php foreach( $terms as $term ) echo ' ' . $term->slug; ?><?php echo ' '.get_post_type( $post->ID ); ?>">
// The Content
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
The javascript —
<script type="text/javascript">
$( function () {
var $container = $('#isocontent');
$container.isotope({})
$('#filter-select,#filter-select2').change( function() {
$container.isotope({
filter: this.value
});
});
});
</script>