[Resolved] Exclude Yoast Breadcrumbs On A Page

Home Forums Support [Resolved] Exclude Yoast Breadcrumbs On A Page

Home Forums Support Exclude Yoast Breadcrumbs On A Page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #264488
    Jam

    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; ?>
    #264615
    Tom
    Lead Developer
    Lead Developer

    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; ?>
    #266043
    Jam

    That worked, Tom. Thanks a lot

    #266045
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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