• Hi,
    I’m using a static page for my posts, which is itself a ‘child’ of a main section, and I’m calling it ‘News’.

    I’m using the following code in sidebar.php, which just shows the children of the current page parent:
    ‘<?php
    if($post->post_parent)
    $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);
    else
    $children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
    if ($children) { ?>

    • <h2>Also In This Section</h2>
      <?php echo $children; ?>

    <?php } ?>’

    so on the parent page, ‘News’ is listed with other ‘child’ pages from that section.
    This all works fine.

    However, when I click on ‘News’, the list of other ‘children’ in that section disappears, although I’ve put the same code in the sidebar of ‘index.php’ (which I’ve copied and pasted, rather than including it).

    My ‘currentification’ of the parent section also disappears, so I can see that the ‘post’ page (index.php) is treated differently from a page, and is therefore not considered a ‘parent’;

    So, is there a way to say:
    ‘list children where section parent = x?’

    I’m possibly trying to bend it a bit far from it’s original purpose, but thought I’d try asking..

    Thanks in advance for any help

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Listing sibling pages when blog is a sub page’ is closed to new replies.