• Why does this only display the items in the last taxonomy and not items from each taxonomy?

    $wpsc_query = new WP_Query(
    	array( 'wpsc_product_category' => 'test1',									    'wpsc_product_category' => 'test2',														      'wpsc_product_category' => 'test3',						       'wpsc_product_category' => 'test4'
    )); ?>
    
    <?php  while ($wpsc_query->have_posts()) : $wpsc_query->the_post();
    	echo wpsc_the_product_title(); 	echo '<br/>';
    endwhile?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • because every usage of 'wpsc_product_category' => 'test2', overwrites the one before;

    try to put the taxs into an array:

    $wpsc_query = new WP_Query(
    	array( 'wpsc_product_category' => array('test1','test2','test3','test4')
    )); ?>
    
    <?php  while ($wpsc_query->have_posts()) : $wpsc_query->the_post();
    	echo wpsc_the_product_title(); 	echo '<br/>';
    endwhile?>

    (untested, you might need to use the taxonomy ids)

    Thread Starter MG7282

    (@mgrinshpun)

    Thank you for responding, but this isn’t returning anything at all even when I try the ids.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Querying multiple taxonomies’ is closed to new replies.