Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter vivacitydesign

    (@vivacitydesign)

    bump…

    Thread Starter vivacitydesign

    (@vivacitydesign)

    Ok, so I worked out how to do what I wanted by changing the code to this:

    <?php
    if($post->post_parent)
    $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0'); else
    $children = wp_list_pages('exclude=13&title_li=<h2>Additional Links</h2>&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    
    <ul>
    <?php echo $children; ?>
    
    </ul>

    But now I’m having another problem!

    This is my page structure:

    TEAMS (PARENT)
    – SENIOR (CHILD of TEAMS)
    – PLAYER PROFILE 1 (CHILD of SENIOR)
    – PLAYER PROFILE 2 (CHILD of SENIOR)
    – PLAYER PROFILE 3 (CHILD of SENIOR)
    ETC
    – JUNIOR (CHILD of TEAMS)
    – PLAYER PROFILE 1 (CHILD of SENIOR)
    – PLAYER PROFILE 2 (CHILD of SENIOR)
    – PLAYER PROFILE 3 (CHILD of SENIOR)
    ETC

    Using the code I posted above, I can only use the wp_list_pages(‘exclude=xx’); on the first parent page (in this case ‘TEAMS’), and it doesn’t work with any pages lower in the hierarchy.

    This means that when you’re looking at the TEAMS page (first PARENT), only the direct children appear in the sidebar (because I’ve manually excluded the other PLAYER PROFILES using the wp_list_pages exclude tag). But when you open one of the child pages (JUNIOR or SENIOR), all children of TEAMS display in the sidebar.

    Can anyone think of a solution to this? I would very much appreciate any feedback!

    Thread Starter vivacitydesign

    (@vivacitydesign)

    Nevermind. I worked it out!

    Thread Starter vivacitydesign

    (@vivacitydesign)

    You’ll have to forgive my naivety, but I’m not sure how to use that piece of code to help me. It looks like it’s just going to display a list of Categories…there’s no conditional codes in there.

    I clarify:

    I have a Parent Page with three Child Pages

    Procedures (PARENT)

    Procedure 1 (CHILD)
    Procedure 2 (CHILD)
    Procedure 3 (CHILD)

    At the moment, I have sidebar setup to display the list of child pages – but ONLY IF the page that is currently being displayed is a PARENT or CHILD that are RELATED.

    I would like to display the RELATED PARENT TITLE above the list of CHILD links.

    Is there a way to do this, whilst still maintaining the conditional nature of the child link display? Furthermore, can I make the title that does appear conditional to which particular parent/child set is being looked at?

    Apologies for the capitals – just trying to make it make more sense.

    I’m looking to do the exact same thing!!

Viewing 5 replies - 1 through 5 (of 5 total)