Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1237724

    I would like to use the RankMath breadcrumb function instead of the native one in Enfold for two reasons:

    1. RankMath’s more granular breadcrumb customizability
    2. 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, 1 month ago by AlexR.
    #1238285

    Dear Enfold Support team,

    did you have time to look at this question?

    Thanks

    Alex

    #1239356

    Hi,

    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,
    Ismael

    #1240189

    Hi 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

    #1240714

    Hi,

    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,
    Ismael

    #1257072

    I 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.

    #1257886

    Hi,

    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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to correctly implement RankMath breadcrumbs in Enfold?’ is closed to new replies.