listing only sub-pages in sidebar (6 posts)

  1. jacynrebekah
    Posted 8 years ago #

    I have extensively read the forums, and perhaps my weak knowledge of php and CSS is keeping me from seeing the answer the I need. Or I've justbeen staring at it too long.

    I have three parent Pages. Each has many subpages. I would like the sidebar to have sections, with headers, that list only the child pages.

    The site is here: http://www.suiciderightonthestage.com

    In the left sidebar there is currently a header, "industry," and below it the link to the parent page, also called "industry." On the right there is a similar set up with "reviews" and "fiction."

    Ideally I would like ONLY the child pages to "industry" appear under that heading. Under "reviews" and "fiction" I would like only the four most recent child pages to appear. I assume this can be done with the wp_list_pages code but I can't figure out how to order the parameters, or maybe even use the right ones. I've re-read the documentation on it about 6 times now, and clearly I'm missing the answer, though I am sure it's there.

    Additionally, is it possible to put code on a parent page, not in the sidebar, but as the body of the page, that would just call a list of all the child pages of said parent?

  2. jacynrebekah
    Posted 8 years ago #

    Is there some trick to getting responses on this forum? Are there other places besides here and in the Codex that I can look for help?

  3. VengeanceFury
    Posted 8 years ago #

    try this widget in your side bar http://wordpress.org/extend/plugins/subpages-widget/ .... it works great.

  4. jacynrebekah
    Posted 8 years ago #

    It looks great, but unfortunately it doesn't do what I need. Partly because my sidebars aren't widget ready, they are basically "hard coded" and partly because it displays the subpages only when you are on the parent page. I need just the subpages displayed on all the pages, all the time, no matter where you are in the site.

  5. VelvetBlues.com
    Posted 8 years ago #

    I think I understand what you are trying to do.

    Since you know that you will only have three 'parent pages', then the simplest way to achieve your sub menus is to use the function like this:

    wp_list_pages('title_li=<h2>'.__('ParentPageName') . '</h2>&child_of=ParentPageID
    '); ?>

    Note: You will have to modify this code for each menu that you plan to create. And be sure to replace 'ParentPageID' with the ID of each parent page, as well as 'ParentPageName' with the name that you'd like to display for each menu header.

  6. jacynrebekah
    Posted 8 years ago #

    Thanks, VelvetBlues, that works! Hooray! But is there a way to limit how many of the childpages appear? Like only the three most recent?

Topic Closed

This topic has been closed to new replies.

About this Topic