With wp_dropdown_pages(); it's able to make a dropdown list with the pages of the blog.

How can I work with this function? I want to get a specific custom field of the "dropdown-selected page". Don't know the way so solve this problem.

1 Answer 1


Not sure what your trying to do with the custom field but you can create your own drop down select using the get_pages() function which returns an array of pages similar to the get_posts() function.

$pages = get_pages();
    foreach( $pages as $page ) {
        echo get_post_meta( $page->ID, 'your_meta_key', true );
  • Sorry but this just helps a little bit. In fact I need to setup a dropdown menu where a user is allowed to choose an existing page. After selecting the entered custom fields of this page will be imported to selecting page.
    – flowdee
    Dec 12, 2011 at 7:51
  • Please explain your question better. So what you want want in the dropdown menu? The page? Where does the custom field come in? Where is the custom field supposed to appear.
    – Chris_O
    Dec 12, 2011 at 8:08
  • The dropdown menu should list the titles of the sites (like delivered through the wp_dropdown_pages function). After choosing a side i should click on a button and the current side should import all the custom field keys and values of the chosen side into the current one. The import can be done by me easily. Just the dropdown and the function to get the page id by dropdown list is my problem
    – flowdee
    Dec 12, 2011 at 9:17
  • Any idea to solve my problem?
    – flowdee
    Dec 15, 2011 at 14:39
  • Actually I'm facing the same problem at this moment and hopefully will figure it out, be patient. Dec 16, 2011 at 19:55

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.