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

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.

share|improve this question
up vote 1 down vote accepted

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 );
share|improve this answer
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 '11 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 '11 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 '11 at 9:17
Any idea to solve my problem? – flowdee Dec 15 '11 at 14:39
Actually I'm facing the same problem at this moment and hopefully will figure it out, be patient. – Wordpressor Dec 16 '11 at 19:55

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.