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.

What is the correct wpdb custom query for this:

taxonomy=pa_main-genre&post_type=product&orderby=name&order=asc

Basically i am trying to do is,list all the terms for pa_main-genre. Thank you very much

share|improve this question

1 Answer 1

If you want a list of the terms, use get_terms():

<?php
$terms = get_terms('pa_main-genre', array('orderby' => name,));
?>
share|improve this answer
    
How about using wpdb class? Like <?php $wpdb->get_results('query', OBJECT_K); ?> –  johndavedecano Jun 19 '12 at 18:32
    
@johndavedecano what would be the reason to use $wpdb? Does get_terms() not return what you need? If so, then I may have misunderstood your question. –  jessica Jun 19 '12 at 18:34
    
I think there is something overriding that function. So i need to use a custom sql query to retrieve the taxonomies terms –  johndavedecano Jun 19 '12 at 18:43

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.