0

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'?

1 Answer 1

1

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.

3
  • sorry for the question, i really missed it, i have got it fixed already, thanks for help anyways.
    – seoppc
    Commented Jun 22, 2012 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
    Commented Jun 22, 2012 at 19:17
  • You have to call meta boxes with get_post_meta or get_post_custom_values
    – Miha Rekar
    Commented Oct 7, 2012 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.