• 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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sage, did you ever get this resolved?

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

    Anybody?

    Figured out a solution based on code samples found here:
    http://codex.wordpress.org/Function_Reference/get_pages

    <?php
    
    $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;  
    
    	}
    ?>

    Thanks for posting this! Exactly what I needed!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘list pages with description’ is closed to new replies.