Trouble listing associated terms with posts of custom taxonomy?
-
I am working on a product based site where i have developed a custom post type and list posts by custom taxonomy i.e. product landing page.
I’m currently doing this using the following code;
<?php
global $post;
$paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1;
$terms = get_the_terms( $post->ID , ‘family’);$draft_posts = $count_posts->draft;
if(!empty($terms)){
foreach ($terms as $term) {
query_posts( array(
‘family’ => $term->slug,
‘posts_per_page’ => 21,
‘caller_get_posts’ => 1,
‘orderby’ => ‘title’,
‘order’ => ‘ASC’,
‘paged’ => $paged,
‘post__not_in’ => $do_not_duplicate ) );if(have_posts() ) {
while ( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?>This works fine and display all of the posts as required, specific to each category in the taxonomy. However, I’m looking for a way to allow the user to filter these results, but I’m not sure how to do this.
I don’t need anything flash, just a simple way of listing the tags associate with all the posts, or the selected terms of another taxonomy. so far everything I have tried will only return results for all posts, not those specific to products/posts listed.
I hope this makes sense and that someone can point me in the right direction.
- The topic ‘Trouble listing associated terms with posts of custom taxonomy?’ is closed to new replies.