Breadcrumb how i can display page title with parent > child title with permalink ? any Idea

function the_breadcrumb() {
global $post;
if (!is_home()) {
    echo "";
        if(is_single()):
        echo 'Main';
        else:
        echo "Home";
        endif;
    echo " / ";
        if ( is_category() || is_single() ) {
            the_category(', ');
            if ( is_single() ) {
                echo " / ";
                the_title();
            }
        } elseif ( is_page() && $post->post_parent ) {
            echo "post_parent)."">".get_the_title($post->post_parent) . "";
            echo " / ";
            echo the_title();
        } elseif (is_page()) {
            echo '';
            echo the_title();
            echo "";
        }
    }
}

Related posts

1 comment

  1. You should change this line:

    echo "post_parent)."">".get_the_title($post->post_parent) . "";
    

    To something like this:

    echo '<a href="'. get_permalink($post->post_parent).'">'. apply_filters('the_title', get_the_title($post->post_parent)) .'</a>';
    

Comments are closed.