The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

list pages with description (4 posts)

  1. sagebrown
    Posted 7 years ago #

    I'm trying to get a list of my wordpress pages in the sidebar, along with a custom key from each page, that I'm using to create a description.

    The list would look like this:

    Page title - description here
    Page title2 - another description

    The description would come from a custom key that I add to each page.

    I've searched EVERYWHERE and can't seem to find an easy way to do this. Any ideas?

  2. MacDoodle
    Posted 7 years ago #

    Sage, did you ever get this resolved?

    I need the same thing, except want to generate the list w/ description on an archive page.


  3. MacDoodle
    Posted 7 years ago #

    Figured out a solution based on code samples found here:

    $pages = get_pages('child_of='.$post->ID); // selects all children of current page
    	foreach($pages as $page) {
     		$custom_blurb = get_post_meta($page->ID, 'custom_blurb', true); // grabs description from custom field
    	echo "<h3><a href=\"".get_page_link($page->ID)."\">$page->post_title</a></h3>";
    	echo $custom_blurb;  
  4. CowboyFrank
    Posted 6 years ago #

    Thanks for posting this! Exactly what I needed!

Topic Closed

This topic has been closed to new replies.

About this Topic