WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Daryl Glass
    Member
    Posted 11 months 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:

    <ul>
    <?php
    $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(); ?>
    </ul>

    Can anybody help?

Reply

You must log in to post.

About this Topic