Forums

configuring wp_list_pages() (2 posts)

  1. angusgrant
    Member
    Posted 1 year ago #

    Hi I have created a page structure which is two levels deep and will remain so. I have one sidebar navigation template page for all web pages in the wordpress site.

    I wish to customise the left navigation page structure so that:

    When I am on any other web page within the (wordpress) website other than those classified as a "page" I wish it to display just the parent page title links (not there children).

    Once on a parent "page" i wish to display only the current parent page title link and its child page links.

    On a child "page" i wish to display its parent category title link and all child pages links .

    I am new to php and am struggling with this task.

    The site i am working on can be found here: http://www.rememberremember.co.uk

    This is the closes that I have got to it in PHP:

    <?php
    $children = wp_list_pages('title_li=&depth=1' );
    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) { ?>
    
          <?php echo $children; ?> 
    
    <?php } ?>

    thanks in advance.

  2. kroatien
    Member
    Posted 1 year ago #

    I'm trynig to find a way to change a ul and li tag (classic theme) in wp_list_pages.
    I get always the <li class="pagenav">

    I'm working on the page:
    Ferienhaus Kroatien

Topic Closed

This topic has been closed to new replies.

About this Topic