1
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 "";
        }
    }
}

1 Answer 1

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>';
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.