• Resolved klattr1

    (@klattr1)


    I was wondering what code I should use in order to display Yoast breadcrumbs above the page content. Here’s the code I’m currently using that’s not working:

    function wp_bc_move( $content ) {
        $custom_content = 'the_breadcrumb();';
        $custom_content .= $content;
        return $custom_content;
    }
    add_filter( 'the_content', 'wp_bc_move' );

    https://wordpress.org/plugins/code-snippets/

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Try using this instead:

    add_filter( 'the_content', function ( $content ) {
        $breadcrumbs = yoast_breadcrumb( '', '', false );
        return $breadcrumbs . $content;
    } );
Viewing 1 replies (of 1 total)

The topic ‘Breadcrumb code to use’ is closed to new replies.