i created filterable portfolio using this tutorial
http://wp.tutsplus.com/tutorials/creating-a-filterable-portfolio-with-wordpress-and-jquery/
everything working well , but it grab the sub tags and its post also not only the main tags . how i can stop this issue ?
<?php
$terms = get_terms("tagportifolio");
$count = count($terms);
echo '<ul id="portfolio-filter">';
echo '<li><a href="#all" title="">All</a></li>';
if ( $count > 0 ){
foreach ( $terms as $term ) {
$termname = strtolower($term->name);
$termname = str_replace(' ', '-', $termname);
echo '<li><a href="#'.$termname.'" title="" rel="'.$termname.'">'.$term->name.'</a></li>';
}
}
echo "</ul>";
?>
<?php
$loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1));
$count =0;
?>
<div id="portfolio-wrapper">
<ul id="portfolio-list">
<?php if ( $loop ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'tagportifolio' );
if ( $terms && ! is_wp_error( $terms ) ) :
$links = array();
foreach ( $terms as $term )
{
$links[] = $term->name;
}
$links = str_replace(' ', '-', $links);
$tax = join( " ", $links );
else :
$tax = '';
endif;
?>
<?php $infos = get_post_custom_values('_url'); ?>
<li class="portfolio-item <?php echo strtolower($tax); ?> all">
<div class="thumb"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( array(215, 215) ); ?></a></div>
<div class="projectcontent">
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<p class="excerpt"><a href="<?php the_permalink() ?>"><?php echo get_the_excerpt(); ?></a></p>
<p class="links"><a href="<?php the_permalink() ?>">More Details →</a></p>
</div>
</li>
<?php endwhile; else: ?>
<li class="error-not-found">Sorry, no portfolio entries for while.</li>
<?php endif; ?>
</ul>
<div class="clearboth"></div>
</div> <!-- end #portfolio-wrapper-->
<script>
jQuery(document).ready(function() {
jQuery("#portfolio-list").filterable();
});
</script>
</div><!-- .entry-content -->
</div><!-- #post -->