• Resolved carlostica

    (@carlostica)


    Hi!

    I created a custom post type with “Custom Post Type UI” under the name of Excursions.

    The /excursions/ is a Page i manually created in “Pages”, and then the excursion go after that.

    For example: /excursions/city-tour.

    In the breadcrumbs should be showing like Home > Excursions > City Tour. But it showing Home > City Tour, ignoring the “Excursions” part.

    Any idea of this?
    Thanks,
    Carlos

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support marcanor

    (@marcanor)

    Hi @carlostica,

    This could be caused due to the way the CPT was created. The /excursions/ page is a Page, while /city-tour/ is a different post type.

    You would need to configure /excursions/ to be the archive page for the CPT.

    We also have some developer filters which can also help you modify the breadcrumbs to include the /excursions/ in the breadcrumbs. You can find them here.

    Thread Starter carlostica

    (@carlostica)

    Hi!

    Thanks for your reply!

    I marked it as a archive too but it didn’t worked.

    I managed to insert the breadcrumb manually with this code (sharing it for the people):

    add_filter( 'wpseo_breadcrumb_links', 'unbox_yoast_seo_breadcrumb_append_link' );
    function unbox_yoast_seo_breadcrumb_append_link( $links ) {
    global $post;
    if( is_singular('excursions')){
    $breadcrumb[] = array(
    'url' => site_url( '/excursions/' ),
    'text' => 'Excursions',
    );
      //array_unshift($links, $breadcrumb);
    	array_splice($links, 1, -2, $breadcrumb);
    }
    return $links;
    }

    Thanks!

    Plugin Support marcanor

    (@marcanor)

    Hi @carlostica,

    Did this resolve the issue?

    Thread Starter carlostica

    (@carlostica)

    Yes!

    I found the fix in here: https://unboxinteractive.com/yoast-breadcrumbs-for-custom-post-types-and-blog-posts/

    I changed the array_unshift to splice to insert it in the middle.

    Thanks!

    Plugin Support marcanor

    (@marcanor)

    Awesome, glad to hear! We are marking this issue as resolved then!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Root Breadcrumb not appearing’ is closed to new replies.