divi breadcrumbs not working in header.php

#168455
  • Resolved Steven
    Rank Math business

    Hi,

    I’ve inserted the code into the bottom of the child theme header.php file as follows but the breadcrumbs no not appear. Here’s the snippet of the last few lines:


    <div id="et-main-area">
    <?php if (function_exists('rank_math_the_breadcrumbs') && !is_home() && !is_front_page()) rank_math_the_breadcrumbs(); ?>
    <?php
    /**
    * Fires after the header, before the main content is output.
    *
    * @since 3.10
    */
    do_action( 'et_before_main_content' );

    Can you please advise how to get this to work correctly?
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    The breadcrumbs code needs to be added to the template page PHP files like page.php, single.php, etc.

    Please add the breadcrumbs code to the page.php file.

    Let us know if you have any other questions.

    We are here to help.

    Steven
    Rank Math business

    Hi thanks, ok that’s not what I read in other support posts. At the top of the page template file?

    Hello,

    Thanks for getting back to us.

    The page template file is usually referenced by the page.php, single.php, and similar files. The file header.php as the name suggests is for the header of the page.

    So, please include the code in the appropriate files, such as the ones I and my colleague mentioned, to see the breadcrumbs correctly.

    Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you require any further assistance.

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

The ticket ‘divi breadcrumbs not working in header.php’ is closed to new replies.