Support » Fixing WordPress » how to use custom taxonomies in query_posts

  • sonill

    (@sonill)


    can anyone please provide me the easiest way to use the custom taxonomies in query_posts.

    i created custom taxonomies like this:

    register_taxonomy( 'products-categories', 'post',
    						  	array( 'hierarchical' => true, 'label' => 'Product Categories', 'query_var' => true, 'rewrite' => true )
    						  );

    hoping for easy solution, thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • borantula

    (@borantula)

    <?php $myproducts=array(
              'post_type'=>'post',
              'product-categories' => 'bubblegums'
      ); ?>
    
    <?php query_posts($myproducts); ?>
    //and the loop comes next
    sonill

    (@sonill)

    thank you for help borantula but the above code does not work.
    It fetched every thing, even those posts which are of other categories.

    Is there any working code sample please.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to use custom taxonomies in query_posts’ is closed to new replies.