• I tried adding wp_list_pages to my theme. Sub-pages are not getting indented. I realize this is a CSS issue, but I really don’t want to mess with the CSS and take the chance of messing something else up. I’m wondering, is there a trick I can use to “force” sub-pages to indent?

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

    Thread Starter WWDay3

    (@wwday3)

    OK, after I wrote my post I realized I did not provide nearly enough info. So, here it is –

    I have a “special” page that has sub-pages. I wanted to display them in the sidebar – separate from other pages – like this:

    Parent
    Child
    Child
    Child

    I first used

    wp_list_pages(‘include=19&title_li=’)

    but the only page I got was the top page. I then tried

    wp_list_pages(‘include=19&title_li=’)
    wp_list_pages(‘child_of=19&title_li=’)

    which listed the page and sub-pages, but did not indent them.

    So, how can I get to my goal?

    Thread Starter WWDay3

    (@wwday3)

    Ah crap, the formatting got messed up. The goal is

    Parent page
    – Child
    – Child
    – Child

    without the ‘-‘ in there.

    <?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) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    might achieve something

    Thread Starter WWDay3

    (@wwday3)

    Thanks, I’ll try that

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_list_pages indent’ is closed to new replies.