• I need some help to see all parents on breadcrumb;
    Now I have this on functions.php

    <em>//====================================Breadcrumbs=============================================================================================
    function wp_fanzone_breadcrumb() {
        global $post;
        echo '<ul id="breadcrumbs">';
        if (!is_home()) {
            echo '
    <li><a href="';
            echo home_url();
            echo '">';
            echo 'Home';
            echo '</li>
    <li class="separator"> / ';
            if (is_category() || is_single()) {
                echo '
    <li>';
                the_category(' </li>
    <li class="separator"> /
    <li> ');
                if (is_single()) {
                    echo '</li>
    <li class="separator"> /
    <li>';
                    the_title();
                    echo '</li>
    ';
                }
            } elseif (is_page()) {
                if($post->post_parent){
                    $parents = get_post_ancestors( $post->ID );
                    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
                    $title = get_the_title();
                    foreach ( $parents as $ancestor ) {
                        $output = '
    <li><a href="'.get_permalink($ancestor).'" title="'.get_the_title($ancestor).'">'.get_the_title($ancestor).'</a></li>
     <li class="separator">/';
                    }
                    echo $output;
                    echo '<strong title="'.$title.'"> '.$title.'';
                } else {
                    echo '
    <li><strong> '.get_the_title().'</strong></li>
    ';
                }
            }
        }
        echo '';
    }</em>

    [Moderator note: Please wrap your code in backticks]
    But in this way I can see only Home, another level and the page where I am…

    Anyone can help to solve?

    Thanks a lot in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello starcodehw,

    did you modify the wp_fanzone_breadcrumb function?..
    if not I think its working as what you needed..

    thanks

    Thread Starter starcodehw

    (@starcodehw)

    I have tried to modify it to see all parents with no results..
    So I have saved again with the original version.
    But i cannot see all page parents.
    If i have home-level#1-level#2-level#3 and I’m on level#3, in the page I can see home-level#1-level#3; i can’t see level#2…

    thanks

    Hello starcodehw,

    so for example you five pages, and the parent page was ‘Main page’. what you gonna do is set all other five pages to make Main page as their parent page. and if page 2 parent page was page 1 then you have to set it also as its parent.. hope this help.

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to see all parents pages visible on breadcrumnb’ is closed to new replies.