• Hi Virtue Support,

    My team really liked thema Virtue
    and we are in the phase of customizing thema.

    At this point we are having difficulty implementing
    Breadcrumbs on every page of the site including the store.

    the code would be this
    <? php if (function_exists (‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs (); ?>

    or
    [rank_math_breadcrumb]

    manually we got

    But I would like it to be below the page titles.

    We have already created thema son.

    We know that Virtue Pro has this native function.

    But we are still in the testing phase.

    Thanks for listening.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 20 total)
  • In your child theme you would need to add a function like this:

    add_action('virtue_header_after', 'custom_breadcrumbs');
    function custom_breadcrumbs() {
    echo '<div class="extra-breadcrubms container">' . do_shortcode( [rank_math_breadcrumb] ) . '</div>';
    }

    Ben

    Thread Starter Paulo Espíndola

    (@paulojardel)

    dear @britner

    I put exact like that in functions.php
    from thema son. virtue-child folder

    <?php
    // Add custom functions here
    
    add_action('virtue_header_after', 'custom_breadcrumbs');
    function custom_breadcrumbs() {
    echo '<div class="extra-breadcrubms container">' . do_shortcode( [rank_math_breadcrumb] ) . '</div>';
    }

    nothing happened.

    Sorry should be a single quote around [rank_math_breadcrumb]

    add_action('virtue_header_after', 'custom_breadcrumbs');
    function custom_breadcrumbs() {
    echo '<div class="extra-breadcrubms container">' . do_shortcode( '[rank_math_breadcrumb]' ) . '</div>';
    }
    Thread Starter Paulo Espíndola

    (@paulojardel)

    dear @britner

    I really don’t know how to do that.

    Can you teach me the step by step.

    I have some knowledge but I’m not an expert

    hannah

    (@hannahritner)

    Hey @paulojarde,
    Did you try pasting Bens updated code into your functions.php in your child theme?

    Hannah

    Thread Starter Paulo Espíndola

    (@paulojardel)

    Yes of course. More the site goes down.

    I tested that code and it works, are you making sure to copy the code from here and not from a notification email?

    Ben

    Thread Starter Paulo Espíndola

    (@paulojardel)

    Here’s the picture of how I’m doing

    https://photos.app.goo.gl/TDgv3qMxJXRY6W8P7

    You are missing the opening php tag in your functions.php file.

    <?php

    That ^ should be the very first line in the file.

    Thread Starter Paulo Espíndola

    (@paulojardel)

    when I put this tag at the beginning the site goes down.
    <? php

    Thread Starter Paulo Espíndola

    (@paulojardel)

    // putting the site down
    <?php
    add_action(‘virtue_header_after’, ‘custom_breadcrumbs’);
    function custom_breadcrumbs() {
    echo ‘<div class=”extra-breadcrubms container”>’ . do_shortcode( ‘<?php if (function_exists(‘rank_math_the_breadcrumbs’)) rank_math_the_breadcrumbs(); ?>’ ) . ‘</div>’;
    }

    // putting the site down
    <?php
    add_action(‘virtue_header_after’, ‘custom_breadcrumbs’);
    function custom_breadcrumbs() {
    echo ‘<div class=”extra-breadcrubms container”>’ . do_shortcode( ‘[rank_math_breadcrumb]’ ) . ‘</div>’;
    }

    // thus placing the error site at the top of the pages

    add_action(‘virtue_header_after’, ‘custom_breadcrumbs’);
    function custom_breadcrumbs() {
    echo ‘<div class=”extra-breadcrubms container”>’ . do_shortcode( ‘[rank_math_breadcrumb]’ ) . ‘</div>’;
    }

    Send a picture of your functions file with <?php added.

    Make certain to copy any code from here not from an email.

    Ben

    Thread Starter Paulo Espíndola

    (@paulojardel)

    Here’s the picture of how I’m doing

    https://photos.app.goo.gl/TDgv3qMxJXRY6W8P7

    I’m not copying from email
    I’m copying here from the site

    Your photo still shows that you are missing <?php

    The functions.php file in your child theme needs to start with that.

    Ben

    Thread Starter Paulo Espíndola

    (@paulojardel)

    hello friend as I said when I put this code in the beginning the site goes down. It is offline. White screen. You see ?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘breadcrumbs does not work’ is closed to new replies.