Support » Plugins » Hacks » filtering terms from get_terms

  • I have two custom taxonomies, one called painting_tag and the other galleries. I’m working on an archive page for galleries.

    At the top of the page I’ve got a list of tags from painting_tag I’m using to filter these posts further. Right now the list shows all painting_tag tags used by my posts. I’d like it to show only tags that are used by the posts in the archive.

    I know in $args there are exclude and include but I’ve failed to get them to do the job.

    $terms = get_terms('painting_tag', $args);
            $count = count($terms);
            if ( $count > 0 ){
                foreach ( $terms as $term ) {
                    echo "<li><a href='javascript:void(0)' data-filter='.".$term->slug."'>" . $term->name . "</a></li>\n";
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘filtering terms from get_terms’ is closed to new replies.