WordPress.org

Support

Support » Themes and Templates » Display pages like category tree

Display pages like category tree

  • I burning my brain to list pages horizontally like a category tree.

    Example on top of single:

    Main > Child Page > Gran Child page > Actual page Title

    Anyone know how to make this? I dont need links to parent pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Chip Bennett
    Theme Review Admin

    @chipbennett

    Take a look at breadcrumb navigation Plugins, or one of the many Themes that incorporate breadcrumb navigation. Most should handle hierarchical Pages.

    Michael
    Forum Moderator

    @alchymyth

    home-made page breadcrumb list:

    <?php $anc = get_post_ancestors($post->ID);
    if( $anc ) :
    $anc = array_reverse(array_merge( array($post->ID), $anc )); //add the direct page to the list, and reverse the list
    $sep = '';
    foreach( $anc as $anc ) {
    echo $sep . get_the_title( $anc );
    $sep = ' > ';
    }
    endif; ?>

    http://codex.wordpress.org/Function_Reference/get_post_ancestors

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display pages like category tree’ is closed to new replies.