WordPress.org

Ready to get started?Download WordPress

Forums

Query posts using same taxonomy term (3 posts)

  1. mistercyril
    Member
    Posted 3 years ago #

    Hello,

    I have custom post types sharing a "Brands" taxonomy with posts.
    I would like to query and list 5 posts (post type "post") in the custom post type "single" template.

    The trick is that i'd like to query posts that use the same "Brands" term.

    <?php
        global $wp_query;
        query_posts(array('post_type' => 'post', "Brands" => "term_name", 'showposts' => 5 ));
        if (have_posts()) : while (have_posts()) : the_post();
        ?>

    In this example "term_name" is hard coded and i'd like it to pick up the current custom post type's "Brands" term (i.e. Cadillac).

    This must be very simple but i'm stuck here.

  2. JoeyBottle
    Member
    Posted 3 years ago #

    Got same problem! Please help somebody. We need it :) Thanks a lot!

  3. devotee
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic