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

I am using the following meta boxes on services page but how would I get the page(s) which have value of this meta box?

For example, list all pages where service_type = 'web'

I am using the following now...

<?php wp_list_pages("title_li=&child_of=15&sort_column=ID"); ?>

But how would I get pages using meta box value like $custom["type"][0] == 'web'?

share|improve this question

Here you go:

<?php wp_list_pages("meta_key=type&meta_value=web&title_li=&child_of=15&sort_column=ID"); ?>

Note the meta_key and meta_value in the syntax and reuse it.

share|improve this answer
sorry for the question, i really missed it, i have got it fixed already, thanks for help anyways. – seoppc Jun 22 '12 at 19:14
can you please help me with 1 more query, above prints list of all pages but how to add meta box values in output. – seoppc Jun 22 '12 at 19:17
You have to call meta boxes with get_post_meta or get_post_custom_values – Miha Rekar Oct 7 '12 at 7:51

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.