Support » Plugin: Breadcrumb NavXT » Disable on home page.

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

    (@mtekk)

    You probably want to look at the last example in this article: https://mtekk.us/archives/guides/calling-the-breadcrumb-trail/ Just replace the checks for !is_page() with a single !is_front_page().

    @mtekk Already using see below: !is_front_page()

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

    All code in the snippet above should be removed and not displayed if front_page

    Plugin Author John Havlik

    (@mtekk)

    @alriksson In the article I linked to, the last code example moves the if statement outside of the div block:

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

    This will prevent the div (or if you wish to, replace div with nav) element from being output when the breadcrumb trail is not included on the page due to whatever condition you place in the if statement.

    @mtekk Aha that one missed it and make sense when it’s wrapped around the nav or div. customized it for my use and is_front_page but do I need is_home as well. When I use below it displays nowhere.

    <?php if(function_exists('bcn_display') && !is_front_page):?>
    <nav class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">
    	<?php bcn_display();?>
    </nav>
    <?php endif; ?>
    • This reply was modified 4 months, 2 weeks ago by  Rookie.
    • This reply was modified 4 months, 2 weeks ago by  Rookie.
    Plugin Author John Havlik

    (@mtekk)

    Yes, the provided code was straight out of the article, you will probably want to modify it as you see fit (especially the if condition).

    @mtekk page-id works but not is_front_page.

    Plugin Author John Havlik

    (@mtekk)

    is_front_page is a function, you need the parentheses after it, e.g. your first line should be:

    <?php if(function_exists('bcn_display') && !is_front_page()):?>

    @mtekk Thanks missed the parentheses after it.

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