• Resolved mangelot

    (@mangelot)


    Hello,

    First of all I really like this plugin, but I have a issue with the breadcrumbs.
    I created a page called “docs” on this page I use the following shortcode only:

    [wedocs]

    I also use Yoast SEO for breadcrumbs, this is working for all other plugins without issues.
    the link: https://www.example.com/docs shows breadcrumb “Home > docs” like it should!

    I created a wedocs group “group” with a section inside called “article”.
    the breadcrumb shows:

    https://www.example.com/docs/group/article
    Yoast breadcrumb shows: home > group > article

    https://www.example.com/docs/group/
    Yoast breadcrumb shows: home > group

    I’m missing the /docs link in the Yoast breadcrumb, how can i fix this?

    Best regards,
    Marco

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mangelot

    (@mangelot)

    fixed this myself… for your interest

    add this code to your themes/functions.php

    add_filter( 'wpseo_breadcrumb_links', 'yoast_seo_breadcrumb_append_link' );
    
    function yoast_seo_breadcrumb_append_link( $links ) {
        global $post;
    
        if ( is_singular ( 'docs' ) ) {
            $breadcrumb[] = array(
                'url' => site_url( '/docs/' ),
                'text' => 'your link text',
            );
    
            array_splice( $links, 1, -2, $breadcrumb );
        }
    
        return $links;
    }

    change your link text to your link text

    Hi @mangelot
    Thanks for sharing the workaround, and glad to hear that you got it fixed!

    As you see, that part is not related to the weDocs’ permalink. Just for your information, if you want to change the default permalink/slug of the weDocs, you can use this filter/hook.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘breadcrumbs issue’ is closed to new replies.