Viewing 10 replies - 1 through 10 (of 10 total)
  • You can hide the breadcrumbs on the home page using CSS. Add the following to your CSS file:

    body.home p#breadcrumbs { display: none; }

    Thread Starter eeprom_one

    (@eeprom_one)

    thank you jjbte for your fast answer…but still doesn′t work..

    is there another solution?.. now the home page display the breadcum…

    Is your home page a static page or your posts page? If it’s your posts page, maybe WordPress doesn’t add the “home” class to the body tag. All my WP sites are either not blogs at all, or posts are of lesser importance, so I always have my home page set to static.

    Anyway, try this CSS code instead:

    body.blog p#breadcrumbs { display: none; }

    If that doesn’t work, or if it affects pages other than your home page, you will need to check your home page source code to see just how it’s constructed (e.g., what unique classes are assigned to the home page body tag, making sure the breadcrumb trail is formatted as described in the Yoast link you provided).

    Thread Starter eeprom_one

    (@eeprom_one)

    hi again jjbte and many thanks for your support..

    i have a static home page with IBUKI Theme.

    I put the string in my main Css file of main theme:

    body.blog p#breadcrumbs { display: none; }

    and doesn′t work…

    how can i sure get the class of my homepage throught my main.css? about your comment

    Thread Starter eeprom_one

    (@eeprom_one)

    this is my main index code:

    <body class=”home page page-id-20 page-template page-template-template-one-page page-template-template-one-page-php logged-in admin-bar chrome windows wpb-js-composer js-comp-ver-4.11.2 vc_responsive customize-support no-scrollable-portfolio-enabled”

    The first piece of code I suggested (with body.home) should have worked. Your home page body tag does indeed have the “home” class assigned to it.

    Did you check the source code for the actual breadcrumb trail? If it doesn’t look something like this:
    <p id="breadcrumbs">...</p>
    then you will need to change the CSS code to account for that. We need to specifically target the breadcrumb container with our CSS code.

    Also, are you using a child theme or modifying your actual theme in order to customize your header.php and CSS files? Does the Yoast Breadcrumb plugin provide its own CSS file? If so, does it include its own styling for #breadcrumbs?

    Thread Starter eeprom_one

    (@eeprom_one)

    Yes the code in Home look like <p id=”breadcumbs”>…</p>.

    I am modifying the Actual Theme, (no child).

    At class-breadcumbs.php in Yoast seo plugin i find this:

    Code:

    /**
    * Determine the crumbs which should form the breadcrumb.
    */
    private function set_crumbs() {
    /** @var WP_Query $wp_query */
    global $wp_query;

    $this->add_home_crumb();
    $this->maybe_add_blog_crumb();

    if ( ( $this->show_on_front === ‘page’ && is_front_page() ) || ( $this->show_on_front === ‘posts’ && is_home() ) ) {
    // Do nothing.
    }
    elseif ( $this->show_on_front == ‘page’ && is_home() ) {
    $this->add_blog_crumb();
    }
    elseif ( is_singular() ) {
    $this->maybe_add_pt_archive_crumb_for_post();

    if ( isset( $this->post->post_parent ) && 0 == $this->post->post_parent ) {
    $this->maybe_add_taxonomy_crumbs_for_post();
    }
    else {
    $this->add_post_ancestor_crumbs();
    }

    if ( isset( $this->post->ID ) ) {
    $this->add_single_post_crumb( $this->post->ID );
    }
    ………………..

    Maybe is this?: $this->add_home_crumb(); ????

    you can view the entire code at:
    https://www.fiestas-en-barco.es/class-breadcrumbs.txt

    thks a lot jjbte!

    Are there any Yoast breadcrumb plugin settings in the admin area that you can adjust? Maybe there’s an option to not show the breadcrumbs on the home page?

    If not, we’ll have to use PHP instead since the CSS didn’t work for some reason. Go back to your header.php file where you added the Yoast breadcrumb code and change it to the following:

    <?php
    if ( !is_front_page() )
      if ( function_exists('yoast_breadcrumb') ) {
        yoast_breadcrumb('<p id="breadcrumbs">','</p>');
      }
    }
    ?>

    This will check to see if we’re on the home page before executing the Yoast breadcrumb code. If we are on the home page, it will not execute.

    On a side note, you’ve probably read this before, but you really shouldn’t modify original theme files. When you perform theme updates, all your modifications will be lost. A child theme is really the best way to go when you need to customize your theme.

    Thread Starter eeprom_one

    (@eeprom_one)

    yeahhh! really works! thank you so much jjbte..

    it’s run perfect now!.

    notes: there’snt this adjust at Worpress seo yoast.
    i know the child but i only change 1 or two strings by webs…

    thanks a lot ann call us when you come to south spain i will invite you to a very good boat party ??

    Glad to help, eeprom_one. And thanks for the offer. If I ever get to visit Spain, I’ll remember that! ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to Display Breadcums in Woocommerce’ is closed to new replies.