Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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; ?>
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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