-
AuthorPosts
-
August 14, 2020 at 10:19 am #1237724
I would like to use the RankMath breadcrumb function instead of the native one in Enfold for two reasons:
- RankMath’s more granular breadcrumb customizability
- Enfold uses the ListItem Schema instead of the better suitable Breadcrumb Schema
How can I replace the Enfold breadcrumb with the RankMath breadcrumb?
I had RankMath support look over this. They investigated my site and recommended I shall get in touch with the Enfold team.According to RankMath I should use the following code in the theme template files to display breadcrumbs:
<?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
However, when adding this code snippet to functions.php, it breaks the visual appearance of the Enfold theme.
Could you please advice on where to put the code snippet to have the breadcrumbs positioned where the Enfold breadcrumbs were?
Thank you!
- This topic was modified 4 years, 3 months ago by AlexR.
August 16, 2020 at 10:28 pm #1238285Dear Enfold Support team,
did you have time to look at this question?
Thanks
Alex
August 20, 2020 at 4:20 am #1239356Hi,
Thank you for the inquiry.
The function or snippet that they provided should be added in one of the template files in the theme. You can add it in the header.php file for example if you want to place the breadcrumb at the very top of the content, or somewhere in the includes > helper-main-menu.php file if you want it near the main menu.
If you don’t want to edit any of the templates, you can also create a new function in the functions.php file that renders the breadcrumb and attach it to an action hook in one of the templates.
// https://developer.wordpress.org/reference/functions/do_action/
Example:
function ava_after_main_container_rank_math_bc() { if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); } add_action('ava_after_main_container', 'ava_after_main_container_rank_math_bc', 10 );
The “ava_after_main_container” hook is in the header.php file.
Best regards,
IsmaelAugust 23, 2020 at 7:03 pm #1240189Hi Ismael,
thank you for your reply. Your solution works great!
I noticed that Schema is not used for the RankMath breadcrumbs. Do you have a suggestion why this might be the case? Everything works perfect except the Schema.Thanks
Alex
August 25, 2020 at 5:18 pm #1240714Hi,
It’s possible that the rankmath breacrumb doesn’t have the schema markup by default. You might have to ask the plugin authors for additional info.
Best regards,
IsmaelOctober 30, 2020 at 4:35 pm #1257072I tried adding the code to functions.php but the Rankmath breadcrumbs show above the header title, instead of the original Enfold breadcrumb location on the right.
Also Enfold shows the breadcrumb schema when breadcrumbs are enabled while having Enfold schema disabled. Thanks.
November 3, 2020 at 7:36 am #1257886Hi,
We might have to adjust the position of the Rankmath breadcrumb with css but we have to inspect the site first. Please create a new thread and post the necessary details in the private field. We will close this one for now.
And as we mentioned above the schema markup for the breadcrumb may not be available by default. Please contact the plugin author for more info about the structure of the breadcrumb.
Best regards,
Ismael -
AuthorPosts
- The topic ‘How to correctly implement RankMath breadcrumbs in Enfold?’ is closed to new replies.