ACF CPT Breadcrumb

#640567
  • Resolved ANF
    Rank Math free

    Hello RankMath,
    I have created a CPT with ACF called “car brands”. The parent page is website.com/car-brands/ with custom posts being website.com/car-brands/toyota/ for example. Can you please advise on how to display the parent page (Car Brands) in the breadcrumb when viewing a child page (/car-brands/toyota/), as only the Homepage (Home) and Child Page (Toyota) are displayed as breadcrumbs, not the parent (Car Brands) page.

    The current Breadcrumb is: Home > Toyota

    The desired Breadcrumb is: Home > Car Brands > Toyota

    Thank you

Viewing 7 replies - 16 through 22 (of 22 total)
  • ANF
    Rank Math free

    Hello Reinelle,
    I have added information to the “Sensitive Data” reply.

    Hello,

    We can’t seem to replicate this issue on our end.

    Can you please confirm if this “Model” is a taxonomy for your Car Brands CPT?

    The set of screenshots you shared is not reachable at the moment: Rank Math support

    Can you please reupload the pictures instead?

    Looking forward to helping you.

    ANF
    Rank Math free

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    ANF
    Rank Math free

    Hello Jeremy,
    I have uploaded the images again. The link is in the Sensitive Data post.

    Hello,

    Please remove all previously shared filters and try using the following filter:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
            if(get_post_type() == 'car-brands') {
                    $parent = ['Car Brands',
    		           'https://rankmath.com' //replace with the URL of the page
    		          ];
    	        array_splice( $crumbs, 1, 0, array($parent) );
            }
    	return $crumbs;
    }, 10, 2);

    Let us know how that goes. Looking forward to helping you.

    ANF
    Rank Math free

    Hello Jaideep,
    Thank you very much!

    The filter works and has resolved the issue. The correct CPT breadcrumb is displaying on all pages.

    Enjoy your day!

    Sophia

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 7 replies - 16 through 22 (of 22 total)

The ticket ‘ACF CPT Breadcrumb’ is closed to new replies.