Forums

Functional Footer (3 posts)

  1. customstudio
    Member
    Posted 2 years ago #

    Hi there,

    I'm creating a theme that is going to use a functional footer containing a sitemap in columns, plus some other contact info. For an example, see http://www.mediatemple.net/.

    My question is around the php code needed to pull in only a page and its sub pages for each column. I understand how to pull in a list of all pages, as in most sidebars, but need to know how to pull in only one page and its subpages on one column, then the next page and subpages on the next column etc.

    Thanks in advance,

    Tom Perkins

  2. zeniph
    Member
    Posted 2 years ago #

    look at
    http://codex.wordpress.org/Template_Tags/wp_list_pages

    note the arguments depth and child_of

    <div>
    <h1>Page 1 name</h1>
    <?php wp_list_pages('depth =>1, child_of => page1-ID-number, '); ?>
    </div>
    
    <div>
    <h1>Page 2 name</h1>
    <?php wp_list_pages('depth =>1, child_of => page2-ID-number, '); ?>
    </div>

    You could make it a little bit more semi-automatic using a value to get page name and page ID but thats the basic idea.

  3. customstudio
    Member
    Posted 2 years ago #

    Really helpful, thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic