Filter posts by specific custom category and current tag (1 post)

  1. Daryl Glass
    Posted 2 years ago #

    I have set up a custom post type (buyers_club) with a custom category (buyers-club) and custom tags (country). I'd like to show a list of related posts by specific category, FEATURED, and by the current tag.

    So far I have this but it isn't working:

    $country_name = strip_tags( get_the_term_list( $wp_query->post->ID, 'country' ) );
    query_posts('post_type=buyers_club&buyers-club=featured&country= .$country_name . &showposts=5');
    while ( have_posts() ) : the_post();
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    Can anybody help?

Topic Closed

This topic has been closed to new replies.

About this Topic