need wordpress sub page (child page) help

Discussion in 'PHP' started by rgordon83, Aug 28, 2007.

  1. #1
    --------------------------------------------------------------------------------

    Ok, so having a small issue with my site.

    By default Sublt is showing ALL sub pages of a certain page. Meaning if i have a page named "Dogs" and then there is a sub page of dogs named "Big Dogs" and then a sub page of big dogs named "Golden Retreivers" Currently the sidebar on "Dogs" shows both "Big Dogs" and "Golden retrievers" but i WANT it to just show "Big Dogs" and then you won't see "Golden Retrievers" until you click on the "big Dogs" page. make sense?

    The current call for sub-pages in the templates looks like

    <div id="child_pages">
    <h3>More Pages</h3>
    <ul class="icon jump">
    <?php foreach ($aSubPages as $page) { echo('<li><a href="' . $page->guid . '">' . $page->post_title . '</a></li>'); } ?> </ul>

    </div>

    Since i don't know WP or PHP that well, can someone please tell me what to change it to do get the desired functionality? (so only child pages show on a page, not grandchildren). thanks!!!
     
    rgordon83, Aug 28, 2007 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
  3. rgordon83

    rgordon83 Peon

    Messages:
    671
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #3
    kind of helped. it made me realize that maybe this is what i really need to change:

    <?php

    if ($aOptions['show_subpages']) :

    global $id;
    $aSubPages = get_page_children($id, '');
    if (count($aSubPages) > 0) :

    ?>

    just not sure what to change it to. this stuff is a bit confusing for me....
     
    rgordon83, Aug 29, 2007 IP
  4. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #4
    edit. . . .

    just reading through some plugins and found this > http://wp-plugins.net/plugin/fold_page_list/ (scroll down the page)
     
    just-4-teens, Aug 29, 2007 IP