• I would like to list the “pages” in my site and also display their custom field data. For example, a list like this:

    Page Title: Description of page (custom field) Image(custom field)

    But it seems like the only template tags that handle anything close to this are for posts, not pages. The page listing function seems so limiting in it’s current state. I have scoured the codex… any advice?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I wanted custom fields/values on Pages so I inserted <?php the_meta();???> into page.php after the post itself. This brings the custom fields in. However, using the write page admin panel – if I create a custom key/value pair for a page, the system puts 2 entries into the database. My created key/value and another of ‘_wp_page_template’ paired with a value of ‘default’. When I display the page, both pairs are shown. Inspecting the Db shows both to be saved. This is replicable every time (1.5.0) have not tried in 1.5.1. I did out this up on the forum but no-one picked it up.

    If you want a particular key, try:

    $keyval = post_custom($key);

    if $keyval is one single value, you can just echo it. Otherwise, you’ll want to do something like:

    $keyval = implode($keyval, ', ');

    first… then echo the result.

    -d

    Thread Starter osakaben

    (@osakaben)

    This is close, but not quite what I need. I need to pull the information about the page before the user visits the page…

    So for example, lets say I made a custom field called “theImage” in each page and assigned it an image. Then I want the parent page to generate a list of all the child pages. Each time through the loop, I would like to pull that key (theImage) so I could have a nice list of the child pages.

    This should be easy, but I just don’t get it.

    The Codex also has no information on post_custom that I could find.

    Thread Starter osakaben

    (@osakaben)

    I thought one solution might be to query the pages based on their category… but it seems that in the admin pages (though categorized) cannot have their categories modified! This is really frustrating.

    Any help at all would be greatly appreciated.

    Thread Starter osakaben

    (@osakaben)

    Well, from what I can tell, there isn’t much customization that can be done with Page listing at the moment… perhaps in a future version of WP it will be a reality. It’s too bad, because this thing is SO close to being a perfect CMS solution. If anybody has perhaps stumbled across anything I might have missed, please feel free to let me know.

    I’m wanting to do something very similiar. I’ve got a set of WordPress pages which have information about products from a particular company. There is a Custom field on each page for the category the product belongs to, lets say “Widget” or “Dodad”. There is another custom field that contains the path to a small image of the product. I would like to have another page that would list all the pages for products that are Widgets and include the name of the page and the small image of the product. Is there a way to do this in WordPress or should I just set up a seperate database outside of WordPress and handle that way?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Getting custom field info from Pages…’ is closed to new replies.