WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] to make a list of child pages? (2 posts)

  1. syncbox
    Member
    Posted 7 years ago #

    I have a page that uses a particular custom field and has multiple entries for it. I have no problem getting it to display. I'm using the c2c custom fields plugin and this is my code:

    <?php
    if (is_page('6')) {
    echo c2c_get_custom ('team-list', $before='<ul id="teamlist"><li>', $after='</li></ul>', $none='', $between='<li> ', $before_last='');
    } else {}
    ?>

    page 6 is the only page that uses this custom field key.

    I would like to know if there is a way to order the returned data?

    Alternatively, if not, then how would one go about listing ONLY the child pages of page 6 as a list, linked to their pages, SORTED by page order? Is that possible?

  2. syncbox
    Member
    Posted 7 years ago #

    nevermind, I found it:

    <?php if(wp_list_pages("child_of=".$post->ID."&echo=0")) { ?>

      <?php wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order&show_date=modified&date_format=$date_format");?>

    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags