• The WP codex talks about displaying custom field metadata inside a post, and I understand that. But there there is also a custom field option for pages.

    1. How do I display page metadata, and
    2. How do I display page metadata outside of the page?

    Ultimately, I want each of my pages to have a tagline defined by the “tagline” custom field. This tagline will be displayed underneath the link in my navbar. So it’ll look like:

    Link list: About        Events          Photos
    Taglines:  Who we are    What we do      Where we do it

    How can I get that data?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Using_Custom_Fields will have pointers for when you are displaying your custom fields in a loop.

    This is also helpful:
    http://comox.textdrive.com/pipermail/wp-hackers/2009-January/023584.html

    Thread Starter mohawktopus

    (@mohawktopus)

    So WP treats pages exactly like posts?

    Pretty much. Change to the WordPress Default Theme, and look at page.php (wp-content/themes/default/page.php). Of course, that template does display Custom Fields ;(

    Thread Starter mohawktopus

    (@mohawktopus)

    So in order to get the links & taglines the way I want, I should edit the wp_list_pages function to include the metadata from each post ID (since pages have post IDs)?

    I will have to defer on that cause I’m totally missing why wp_list_pages comes into this discussion.

    Thread Starter mohawktopus

    (@mohawktopus)

    I want to change wp_list_pages(), so when it iterates through each page, will also iterate through each page’s tagline meta_key and display that text alongside the page name.

    wp_list_pages() comes into the discussion because I want that function to generate what I just described. So for each page displayed, it will also display that page ID’s tagline metavalue.

    Am I making sense?

    Thread Starter mohawktopus

    (@mohawktopus)

    Maybe I’m not. I’m gonna see if wp_page_menu() is a better option.

    I think you’re making sense… I think I’m looking to do the same kind of thing.

    I want to list all the child pages of a certain page and along with the title of the page include some custom field metadata (so it would basically be a link to the page with a short description of what is on that page below it)

    I can’t see a way to do it, and editing wp_list_pages looks a bit mind blowing for my meagre php skills… Did you ever find a way to do it?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Display Custom Field Data in Pages’ is closed to new replies.