• Resolved blondie53185

    (@blondie53185)


    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!

    https://www.ads-software.com/extend/plugins/breadcrumb-navxt/

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter blondie53185

    (@blondie53185)

    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!!

    Plugin Author John Havlik

    (@mtekk)

    Do not check $post->ID explicitly, it isn’t something you should rely on. Use the WordPress conditionals (see https://codex.www.ads-software.com/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.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Breadcrumb NavXT trail from multiple pages’ is closed to new replies.