[Resolved] Rankmath breadcrumb code position

Home Forums Support [Resolved] Rankmath breadcrumb code position

Home Forums Support Rankmath breadcrumb code position

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2018341
    jokerduniya

    Rankmath asked me to do the following:
    Use the following code in your theme template files to display breadcrumbs. Learn More
    <?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?> OR [rank_math_breadcrumb]

    According to the guide video: https://youtu.be/30jgc9RXLVo the position is not clear.

    Under Theme Editor where am I supposed to put the code? Please help.

    #2018407
    Ying
    Staff
    Customer Support

    Hi there,

    It depends on where you want the breadcrumbs to be placed?

    Here’s a video from GP on how to add breadcrumbs: https://youtu.be/GkJq5fMwDxs

    If you follow this video tutorial, the shortcode is what you are gonna use: [rank_math_breadcrumb].

    Let me know if this helps 🙂

    #2018974
    jokerduniya

    Hello Ying,

    I watched the video. On 1:25/4:59 where they are putting element type.

    Unfortunately, I have no such option. As you can see in the attachments.

    Please guide.

    #2018982
    Elvin
    Staff
    Customer Support

    Hi there,

    Under Theme Editor where am I supposed to put the code? Please help.

    Do you have a child theme? If so, you can place this code on your child theme’s functions.php.

    add_action( 'generate_before_entry_title', function(){
        if ( function_exists('rank_math_the_breadcrumbs') ) {
            rank_math_the_breadcrumbs(); 
        }
    });

    Alternative to functions.php, you can run this code on your site using a Code Snippets plugin.
    https://docs.generatepress.com/article/adding-php/

    Unfortunately, I have no such option. As you can see in the attachments.

    It’s not showing up because you’re using Classic editor for your site. The demo video is using WordPress’ latest default editor, Gutenberg.

    A wise man once said:
    "Have you cleared your cache?"

    #2019047
    jokerduniya

    As per I can see it is not a child theme.

    Can you please check and tell me?

    Thank you. The breadcrumb is visible now. The size of the font is very big and quite absurd. Can we fix this?

    #2019057
    Elvin
    Staff
    Customer Support

    Try adding this CSS to adjust the font-size.

    nav.rank-math-breadcrumb {
        font-size: 14px;
    }

    You can add this on Appearance > Customize > Additional CSS.

    A wise man once said:
    "Have you cleared your cache?"

    #2024134
    jokerduniya

    Thank you very much Elvin. As usual, you nailed it.

    Can you please reduce the gap above the breadcrumb?

    #2024155
    David
    Staff
    Customer Support

    Hi there,

    the space above the breadcrumb comes from the Customizer > Layout > Container –> Top Padding. You can reduce that there and it will keep the space uniform across the site.

    #2024836
    jokerduniya

    Thank you.

    #2025899
    David
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.