• Resolved likocorp

    (@likocorp)


    Hello
    Could you please telll me what I am doing wrong.

    First to show the breadcrumb on my site I input following code to my header.php

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

    It works fine.

    Then I want to disable breadcrumb from home page.
    I try to put the following code in the same header.php just below existing.

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

    In this case I get the following error in this file

    syntax error, unexpected ';' in the line
    <?php if(function_exists('bcn_display') && !is_front_page()){ ?>

    Could you please advice what to do with this error?
    Thank you!

    • This topic was modified 4 years, 7 months ago by likocorp.
    • This topic was modified 4 years, 7 months ago by likocorp.
    • This topic was modified 4 years, 7 months ago by likocorp.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Havlik

    (@mtekk)

    Try:

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

    I assume you grabbed that from the FAQ, there currently is a bug in WordPress and SyntaxHighlighter that messes up code in posts (adds HTML entities when that should not be done in code blocks).

    Thread Starter likocorp

    (@likocorp)

    Great thanks, John!
    I input your code. And now it saves without errors.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing breadcrumbs from home page’ is closed to new replies.