Question while Enabling Breadcrumbs on Website With Rank Math SEO plug-in.

#707105
  • Resolved Anonymous
    Rank Math free

    Hi Team,

    I read this article from the Rank math website. As per the steps shown in article, i enabled the Breadcrumb option from the Rank math plug-in general settings. But after that, i found that, there are multiple methods to Adding Breadcrumbs to Website. From those methods, i decided to add Breadcrumbs by Adding code to the Theme file editor.

    So, i copied the code from the Plugin, but later, i didn’t find any exact file location in article where the code has to be placed.

    Code: <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>

    So, please guide me regarding that, where exactly i have to add code? I mean, in which file, under which code like that.

    Theme: GeneratePress

    Thanks.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello,

    We apologize for the confusion you’re experiencing. To add the breadcrumbs code to your theme’s template files, you’ll need to navigate to the WordPress Dashboard and access the Theme File Editor. Since you’re using the GeneratePress theme, you can find the Theme File Editor by going to WordPress Dashboard → Appearance → Theme Editor.

    Once you’re in the Theme File Editor, you will see the theme files on the right side. You should select your child theme template and add the breadcrumbs code to the appropriate location in your theme’s template file to display the breadcrumbs.

    If you’re unsure about which file to edit, it’s best to reach out to the GeneratePress theme developer for guidance. Alternatively, you can also contact Rank Math’s support team directly, and we’re available 24×7 to help you out.

    We hope this helps! If you have any further questions or need additional assistance, please feel free to ask.

    Sources:
    How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math
    How to Make Your Theme Rank Math Compatible » Rank Math
    Rank Math General Settings

    Hello,

    Thank you for your query, and we are so sorry about the trouble this must have caused.

    You can add the below code to the content-page.php file to add the breadcrumbs on all pages except the homepage.

    if (function_exists('rank_math_the_breadcrumbs') && !is_front_page()) rank_math_the_breadcrumbs();
    

    Please refer to the screenshot below :
    https://monosnap.com/direct/zRBBirY69T1lXbpxdUowgrWNL4bpCT

    We hope that helps, and please don’t hesitate to get in touch if you have any other questions.

    Thank you.

    Hello,

    That’s because the file you are adding the breadcrumbs code to is meant for pages only. You’ll have to insert the code to a file that can be rendered in both single posts and pages or even taxonomies archives.

    Usually, themes include header.php and single.php files which is the best place to insert breadcrumbs.

    If you like, we can check this in your website and insert the code ourselves. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Anonymous
    Rank Math free

    Hi Team

    Thanks for Reply. Sorry, i can’t share the Log in details. But i can share the different files used in My website theme (Generatepress). Please check the attached screenshot below.

    Thanks.

    Hello,

    Please try to add the following breadcrumbs code in your single.php file and make sure to add this inside your content area and see if that works for you.

    <?php if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs(); ?>
    

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

    Thank you.

    Anonymous
    Rank Math free

    To add the Rank Math SEO plugin breadcrumbs code to your GeneratePress theme, you’ll need to follow these steps:

    Access Your Theme Files:

    Log in to your WordPress admin dashboard.
    Go to “Appearance” and select “Theme Editor.”
    Locate the Theme Header File:

    In the Theme Editor, look for the theme header file, typically named header.php.
    If you can’t find it, check the header folder.
    Insert the Breadcrumbs Code:

    Open the header.php file for editing.

    Find the appropriate location to add the breadcrumbs code. Usually, it’s best to add it just before the closing </header> tag or immediately after the opening <body> tag.
    Paste the Rank Math breadcrumbs code:
    <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>

    Save Changes:

    After adding the code, save the changes to the header.php file.
    Verify Breadcrumbs:

    Visit your website and navigate to a page with a hierarchical structure (like a category or a post with categories and tags).
    Check if the breadcrumbs are now visible.
    Please note that modifying theme files directly can be risky. Ensure you have a backup of your website before making changes. Additionally, if you’re uncomfortable editing theme files, consider using a child theme or consulting with a developer.

    Hello @maxwel,

    Thank you for reaching out and we appreciate your contribution on resolving the issue.

    @pratikambukar,

    When you add that specific code format inside the php file, it may cause a fatal error. Please use this instead inside the file which already has the PHP opening and closing tag (<?php ... ?>):

    
    if (function_exists('rank_math_the_breadcrumbs')) rank_math_the_breadcrumbs();

    You may try adding the code after line 15.

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

    Anonymous
    Rank Math free

    Thank you for the guidance! I’ve implemented the suggested code within the existing PHP tags (<?php … ?>) as advised. It’s added after line 15. I’ll monitor the situation and let you know how it goes. Your assistance is greatly appreciated, and I’ll reach out if any further help is needed. Thanks again!

    Hello,

    Sure, let us know how this goes.

    Meanwhile, if you have any other concerns, please don’t hesitate to contact us anytime to assist you further.

    Looking forward to helping you.

    Thank you.

    Anonymous
    Rank Math free

    Hello,

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

    Thank you.

    Hello,

    We apologize for the inconvenience.

    Please put the code after the <?php opening tag. See how it goes.

    Looking forward to helping you.

    Hello,

    In this case, I suggest checking with Generatepress to help you add the breadcrumbs code to your theme as they know best their theme structure and where to insert the code to get the desired result.

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

    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 12 replies - 1 through 12 (of 12 total)

The ticket ‘Question while Enabling Breadcrumbs on Website With Rank Math SEO plug-in.’ is closed to new replies.