Support » Plugin: Breadcrumb NavXT » Remove breadcrumbs from pages only

  • Resolved acurtis

    (@tnovak)


    How do we remove the breadcrumbs and disable them from displaying on pages only? I run a blog but also have some pages that I don’t want to have any navigation on as they are “landing pages” where I’m trying to get the visitor to complete a form so I don’t want any navigation on it. I have tried removing the templates for the pages and unlinked pages under the settings, leaving no code for them, but they still show up. I’m running the Vantage template from SiteOrigin.

    I found this possible fix on another site, to add this code to the breadcrumb.php file where they are called from, however it doesn’t work, at least not in my theme or current version of WP.

    if (
        ! is_page()
        || ! in_array( get_the_ID(), $ids )
    ) {
        bcn_display();
    }

    It would be wonderful if there were just a checkbox for each type of taxonomy that would enable and disable on those types. Maybe that could be a feature request but for now I just need to know how to remove them. I’m running the latest version of WP and the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Havlik

    (@mtekk)

    Normally, if you do not want the breadcrumb trail to show up on any page (instance of the Page post type) you would use something like:

    <?php if(function_exists('bcn_display') && !is_page()){ ?>
        <div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">
            <?php bcn_display(); ?>
        </div>
    <?php } ?>
    

    Deleting the contents of the breadcrumb templates for the page post type will not do anything as Breadcrumb NavXT will use the default templates if the template is blank.

    Thank you very much John. That worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove breadcrumbs from pages only’ is closed to new replies.