Site logo

Archived topic

Exclude Yoast Breadcrumbs On A Page

3 replies · Started by Jam on January 16, 2017

Viewing posts 1–4 of 4

Hi
I would like to exclude Yoast breadcrumb on a page.

I tried to use this code which worked on a different hook (which is just an HTML code). But it must be a different one for this Yoast code because this returns an error.

The code I used:

<?php if ( ! is_page( array( '1268', '6' ) ) ) : ?>
    <?php echo do_shortcode( '[<?php if ( function_exists('yoast_breadcrumb') ) 
{yoast_breadcrumb('<p id="breadcrumbs">','</p>');} ?>]' ); ?>
<?php endif; ?>

No need to echo the shortcode, you can just do this:

<?php if ( ! is_page( array( '1268', '6' ) ) ) :
    if ( function_exists('yoast_breadcrumb') ) {
        yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    }
endif; ?>

That worked, Tom. Thanks a lot

You're welcome :)

This archived topic is closed to new replies.