Breadcrumbs Position

#70547
  • Resolved Sall
    Rank Math free

    Hello,

    I use the Divi Theme and have the Rankmath Breadcrumbs activated. and they are displayed. But I have the following issues:

    1. I want to hide the Breadcrumb shown on the Homepage. I have actually the following snippet in the header.php:

    add_filter( ‘the_content’, function( $content ) {
    if( function_exists( ‘rank_math_get_breadcrumbs’ ) ) {
    $content = rank_math_get_breadcrumbs() . $content;
    }
    return $content;
    });

    I found now here in the Support Forum the following snippet what should hide the Breadcrumb on the Homepage:

    <?php if (function_exists(‘rank_math_the_breadcrumbs’) && !is_home() && !is_front_page()) rank_math_the_breadcrumbs(); ?>

    But if I replace the first snippet with the second snippet, the website is not accessible.

    Can you please let me know, how do i merge the 2 snippets to get it work?

    2. I get the Breadcrumbs also shown in the Posts, but the problem is, that they inserted after the Featured Images of the Posts, and I would like to display them inside the Posts before the Post Titles, like actually on my website, how can I do that?

    Thanks a Lot!

    Best regards
    Sally

Viewing 5 replies - 1 through 5 (of 5 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I changed the line 258 in the file header.php (commented the current Rank Math breadcrumbs implementation) and the line 41 in the file single.php (added the Rank Math breadcrumbs there). After that, the breadcrumbs are like the ones you have in the live site, could you check them?

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Sall
    Rank Math free

    Hello Alberto,

    thanks a lot for your help! Yes the Breadcrumbs in the Posts are shown now on Top of the Posts, perfect.

    But what I discovered now is, that the Breadcrumbs on the Pages for example test.domain.org/designers/ are missing now ..

    Also what would be the css class to style the size for example?

    Best regards
    Sally

    Hello,

    I am unable to edit your theme files, I get the error Unable to communicate back with site to check for fatal errors, so the PHP change was reverted.

    To add breadcrumbs in your header you can revert back to your previous breadcrumb code but with a little bit of customization as shown below:

    
    add_filter( 'the_content', function( $content ) {
    			if( function_exists( 'rank_math_get_breadcrumbs') && !is_home() && !is_front_page() ) {
    			$content = rank_math_get_breadcrumbs() . $content;
    			}
    			return $content;
    			});
    

    For breadcrumb styling you can customize the following:

    
    .rank-math-breadcrumb a {
    font-family: sans-serif!important;
    font-size: 14px;
    }
    .rank-math-breadcrumb {
    font-family: sans-serif!important;
    font-size: 14px;
    }
    

    Looking forward to helping you. Thank you.

    ​​​​​​

    Sall
    Rank Math free

    Hello Michael,
    thanks a lot, the css snippets are working:)

    Best regards
    Sally

    Alberto
    Rank Math business

    Hello Sally,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this ticket.