WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct wpdb custom query for this:


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

share|improve this question

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

$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


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.