Parent page not coming in breadcumbs shortcode.

#701771
  • Resolved Naznin Kamal
    Rank Math free

    In the breadcrumbs shortcode, the parent page is not coming. Only the home and child page is coming.

    This is what we need: Home » Services(parent page) » Partial Hospitalization Program (PHP)
    What we get now: Home » Partial Hospitalization Program (PHP)

    https://prnt.sc/-k4z7NDCcLsO

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello, I’m sorry to hear that you’re experiencing issues with the breadcrumbs shortcode. It seems that the parent page is not appearing as expected in the breadcrumbs.

    To ensure that the parent page appears in the breadcrumbs, you can use the following code snippet in your theme’s template files:

    If you’re using a block theme like Twenty Twenty-Two, you can add Rank Math’s Breadcrumbs to any page by following these steps:

    1. Head over to WP Admin Dashboard → Appearance → Editor.
    2. Select the top left corner of your dashboard and choose any one of the templates where you want to add the breadcrumbs.
    3. Search for shortcode and add the following shortcode right inside the block.

    If you’re using Oxygen Builder, you can add the breadcrumbs by using the shortcode widget and entering the following shortcode: [rank_math_breadcrumb].

    If you’re still facing issues after trying these steps, please feel free to reach out to our support team directly from here, and we’re always here to help.

    I hope this helps!

    Sources:
    How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math
    Is Rank Math SEO Compatible With Oxygen Builder? » Rank Math
    Multilingual SEO with Rank Math SEO & WPML » Rank Math

    Hi.I am using generatepress theme. I am using the same breadcrumbs shortcode[rank_math_breadcrumb] in the ‘Elements’. But its not working.

    Hello,

    For troubleshooting, head over to Rank Math > General Settings > Breadcrumbs and enable the Show Category option

    show

    If the issue persists, please share the affected URL so we can check as well.

    Looking forward to helping you.

    Thanks for your reply. But it’s not working.

    URL : https://hopesdestiny.com/blog/services/partial-hospitalization/

    Hello,

    We’ve checked your site, and the Services is indeed a page, that’s why it’s not getting included in the breadcrumbs to support the hierarchical function of your single posts.

    However, to customize the breadcrumbs and add them when viewing the post, you may use this filter on your site:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
            //Adding to single posts
    	if(is_singular('post')){ // change to match the actual custom post type name
                    $value[] = array(
    		'Services', 
                    'https://hopesdestiny.com/services/', 
                    'hide_in_schema' => false
    		);
                    //add this value as the second item in array
    		array_splice( $crumbs, 1, 0, $value ); 
    		return $crumbs; 
    	}
    	return $crumbs;
    }, 10, 2);

    And here’s a guide to adding the code to the website:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘Parent page not coming in breadcumbs shortcode.’ is closed to new replies.