Support » Themes and Templates » Display posts by multiple categories within custom post type

  • coold78

    (@coold78)


    I’ve created a custom post type (Wine List) and I am displaying a list of items on a page. The list (or posts) are separated into groups by Custom Taxonomies. I want to separate the list down even more using tags.

    Here is a sample code I use for each group:

    <?php query_posts( array(
    					'wine-type' => 'white-wine',
    					'page_per_posts' => -1,
    					'post_type' => 'wine_list',
    					'orderby' => 'ID',
    					'order' => 'ASC'
    					) ); ?>
    
    <?php query_posts( array(
    					'wine-type' => 'champagne',
    					'page_per_posts' => -1,
    					'post_type' => 'wine_list',
    					'orderby' => 'ID',
    					'order' => 'ASC'
    					) ); ?>

    The first displays all posts within White Wine category and the second query displays all post within the Champagne category. The problem I’m having is breaking down the White Wine category into separate groups. Every time I try, each group displays all posts within the White Wine category.

    What is the best way to do this? Thanks

  • The topic ‘Display posts by multiple categories within custom post type’ is closed to new replies.