• Resolved Pascalvd

    (@pascalvd)


    Hi,

    I’m experiencing some issues with the implementation of breadcrumbs for a custom post type. I have a CPT called ‘Reviews’. The archive page is working properly, as well as its breadcrumbs, which shows ‘Home >> Reviews’. However, when I navigate to a specific post within that CPT, the breadcrumbs only show ‘Home >> Post’.

    How do I get the post breadcrumbs to show as ‘Home >> Reviews >> Post’? I can only find an option to append a taxonomy to the breadcrumbs, but not the archive page. Is this possible with a filter/hook? Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    We would like some more information.

    1. We had another recent release. Can you confirm you are using the most recent Yoast SEO, v15.6.2? If you update, does the issue resolve?

    2. Are all your non-Yoast plugins and themes also updated?

    3. Can you confirm you are using WordPress 5.6? You can check by clicking on the W in the top left and selecting About. If you need to update, please check with your host provider.?Please know that if you are using an older version of WordPress Core you may experience unexpected behavior with Yoast.?This guide explains more:?https://yoast.com/why-we-dont-support-old-wordpress-versions/.

    4. How are the CPT made? Are you using a plugin? If so, which one?

    5. Can you provide a link that highlights the issue?

    Thread Starter Pascalvd

    (@pascalvd)

    Hi,

    First of all, thanks for your response.

    1. We’re currently running v15.7 which is the latest version. Unfortunately this does not resolve the issue.

    2. All other plug-ins and themes are updated as well.

    3. We’re running WordPress 5.6.

    4. The CPT is built through the functions.php file. I’ve made sure to set has_archive to true. Please find the arguments that are used to create the CPT below:

           'label'               => __( 'reviews'),
            'description'         => __( 'Reviews' ),
    	'taxonomies'		  => array('post_tag'),
            'labels'              => $labels,
            'supports'            => array( 'title', 'editor', 'excerpt', 'author', 
            'thumbnail', 'comments', 'page-attributes', 'revisions', 'custom-fields' ), 
            'hierarchical'        => false,
            'public'              => true,
    	'has_archive'		  => true,
            'show_ui'             => true,
            'show_in_menu'        => true,
    	'show_in_rest'		  => true,
            'show_in_nav_menus'   => true,
            'show_in_admin_bar'   => true,
            'menu_position'       => 6,
            'can_export'          => true,
            'exclude_from_search' => false,
            'publicly_queryable'  => true,
            'capability_type'     => 'post',
    	'query_var'			  => true

    5. This link directs you to the archive page, and this link directs you to an example of a custom post type page.

    Thanks in advance!

    • This reply was modified 3 years, 10 months ago by Pascalvd.

    Hi @pascalvd,

    Thanks for the example links. There isn’t a feature or setting in Yoast SEO to automatically add the custom post type’s archive link to the breadcrumbs.

    However, you do have the option to customize and add breadcrumbs using the ‘wpseo_breadcrumb_links’ filter. You can see an example of how that’s done in this code example: https://gist.github.com/amboutwe/ea0791e184668a5c7bd7bbe357c598e9#file-yoast_seo_breadcrumb_append_link-php.

    Thread Starter Pascalvd

    (@pascalvd)

    @priscillamc thanks a lot for that! I’ve managed to fix it using the provided example.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Include archive page in CPT breadcrumbs’ is closed to new replies.