The Rank Math SEO plugin simplifies the process of incorporating SEO breadcrumbs into your Divi website. In this comprehensive guide, we will walk you through the steps to enable breadcrumbs, tailor their appearance, and specify where they should be displayed on your site.
Method One: Using a Shortcode:
Install and activate the Rank Math SEO plugin.
Navigate to Rank Math > General Settings > Breadcrumbs.
Activate the "Enable Breadcrumbs" option.
(Optional) Personalize the appearance of the breadcrumbs to align with your site's design.
To effortlessly display the breadcrumb trail without going into PHP code, simply copy the [rank_math_breadcrumb] shortcode. For Divi pages/theme builder templates, you can employ a Text Module or Code Module to insert this shortcode.
Method Two: Implementing breadcrumbs with PHP
To integrate breadcrumbs into your pages and posts using this method, you'll need to make adjustments in a child theme's single.php file.
Copy the single.php file's code from the parent Divi theme and create a new file named single.php within your child theme directory in your theme folder in wp-content > themes > Divi. Paste the contents from the parent theme's single.php file into this new file.
Insert the following line of code:
<?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
This code should be placed after this line in the single.php file:
$is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );
After implementing this code, your file will display the following:
Add the following code to your child theme's functions.php file:
* Register theme support for Rank Math breadcrumbs
add_theme_support( 'rank-math-breadcrumbs' );
After including this code, your functions.php file will appear as follows:
With these adjustments in place, your breadcrumb functionality will seamlessly enhance your website's user experience and navigation.
Furthermore, using FTP or cPanel to access the file manager is recommended. This will enable you to safely implement changes and, in the event of any issues during the tutorial, easily revert back to the previous state.