0

I use the following custom loop to display a custom post type with the custom taxonomy:

<?php // Create and run custom loop
    $custom_posts = new WP_Query();
    $custom_posts->query('post_type=page_content&page_sections=Apps');
    while ($custom_posts->have_posts()) : $custom_posts->the_post();
?>
    <div class="block-1">
        <?php the_post_thumbnail('large'); ?>
    </div>
<?php endwhile; ?>

Right now it reads: retrieve ONLY posts with the page_content custom post type and the App custom taxonomy.

Is it possible to make it read: retrieve ONLY posts with the page_content custom post type, the Front Page custom taxonomy, and the Apps custom taxonomy?

EDIT:

This didn't work:

<?php // Create and run custom loop
        $custom_posts = new WP_Query();
        $custom_posts->query('post_type=page_content&page_sections=Front Page, Apps');
        while ($custom_posts->have_posts()) : $custom_posts->the_post();
    ?>
        <div class="block-1">
            <?php the_post_thumbnail('large'); ?>
        </div>
    <?php endwhile; ?>
1

In versions less the 3.1 you can't query more then one taxonomy using wp_query, query_posts or get_posts. However you can create your own sql query which you can see an examenter link description hereple here or use scribu's plugin http://scribu.net/wordpress/query-multiple-taxonomies/ To make it work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.