[Resolved] Breadcrumb Shortcode

Home Forums Support Breadcrumb Shortcode

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1439570
    Eric

    Hi,

    I use your shortcode structure to make a shortcode for Breadcrumb nav XT
    to display it in hook element for blog post but shortcode returns nothing, no breadcrumb after ‘You are here’ 🙁
    Thanks for your help

    add_shortcode( 'breadcrumb', function() {
        ob_start();
        // Start your PHP below
      if ( function_exists( 'bcn_display' ) && ! is_front_page() ) {
        echo '<div class="breadcrumbs">
        You are here: <?php bcn_display(); ?>
    </div>';
      }
        // End your PHP above
        return ob_get_clean();
    } );
    #1439574
    Leo
    Staff
    Customer Support

    Hi there,

    Any reason why you need to turn it into a shortcode instead of just adding it as a function using a hook element?

    Also are you sure the plugin doesn’t provide a shortcode option to insert breadcrumb without you creating one? I know Yoast does for sure.

    #1439734
    Eric

    Hi,
    I made a hook but how can I display it to be under the title “#inspiration” ? 🙁
    Thanks in advance

    #1439825
    Eric

    Hi,
    Here is the shortcode for those who are interted in :
    function my_breadcrumb() {
    if(function_exists(‘bcn_display’) && !is_front_page()) {
    $breadcrumb_output = ‘

    ‘;
    return $breadcrumb_output;
    }
    }
    add_shortcode( ‘my_breadcrumb’, ‘my_breadcrumb’ );

    #1439881
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Looks like you set this to resolved – did you get it sorted?

    #1452697
    Anna

    Hello. I can ask you recording video, step by step how create breadcrumbs. (I’m use Yoast plugin).

    I can’t understand what I must to do, for add breadcrumb in theme.

    Thanks.

    #1452725
    Leo
    Staff
    Customer Support

    Any chance you can try the step by step guide here first?
    https://docs.generatepress.com/article/adding-breadcrumbs/#using-hooks-element

    If this doesn’t work, please start a new topic and let us know which part you are struggling with.

    Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.