Site logo

Archived topic

Breadcrumb Shortcode

6 replies · Started by Eric on September 11, 2020

Viewing posts 1–7 of 7

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();
} );

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.

Hi,
I made a hook but how can I display it to be under the title "#inspiration" ? :(
Thanks in advance

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' );

Hi there,

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

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.

This archived topic is closed to new replies.