WordPress.org

Ready to get started?Download WordPress

Forums

Breadcrumb NavXT
[resolved] Remove Breadcrumb NavXT trail from multiple pages (5 posts)

  1. blondie53185
    Member
    Posted 2 years ago #

    I am using the Breadcrumb NavXT plugin and have successfully modified the header.php in my child theme for Twenty Eleven so that the trail does not display on the front page using:

    <div id="main">
    <div class="breadcrumbs">
        <?php if(function_exists('bcn_display') && !is_front_page())
        {
            bcn_display();
        }?>
    
    </div>

    [Please post code snippets between backticks or use the code button.]

    Please tell me how I would modify this code so that the breadcrumb trail doesn't display on two of my landing pages also. I have no php experience but can follow directions very well.

    Thanks!

    http://wordpress.org/extend/plugins/breadcrumb-navxt/

  2. Nikki Blight
    Member
    Posted 2 years ago #

    If you're looking to exclude specific pages, I would just do something like:

    <?php if(function_exists('bcn_display') && !is_front_page() && $post->ID != XX)
        {
            bcn_display();
        }?>

    where XX is the ID of the page you want to exclude. Just add an additional && $post->ID != XX for each page. You could also use $post->post_name != 'my-post-slug' and exclude pages by slug.

  3. blondie53185
    Member
    Posted 2 years ago #

    Thank you so much - this one was easy to figure out where the code goes because you showed a little bit of my existing code. Excellent instructions!!

  4. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    Do not check $post->ID explicitly, it isn't something you should rely on. Use the WordPress conditionals (see http://codex.wordpress.org/Conditional_Tags ) instead. E.g. use:

    <div id="main">
    <div class="breadcrumbs">
        <?php if(function_exists('bcn_display') && !is_front_page() && !is_page(xx))
        {
            bcn_display();
        }?>
    
    </div>

    where xx is the ID of the page, or the slug for the page.

  5. KylieZona
    Member
    Posted 2 years ago #

    Blondie - thanks for the code to not display breadcrumbs on home. This was great for me:)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic