Home Forums WoodMart support forum Breadcrumb Brand Schema.org

Breadcrumb Brand Schema.org

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #332942

    DanyM
    Participant

    Hi, I have a problem with breadcrumbs in the Brand attributes section (frontend).
    I have enabled the archives for brand, so my url is:
    https://domain.it/brand/brandname

    When I click on a brand logo I enter https://domain.it/brand/brandname correctly but the breadcrumbs for brand have this slug: Home/prodotto brand/brandname, this is not good for my SEO optimization.

    I need the breadcrumbs to be exactly as in the url and the word “prodotto brand” replaced with “brand” (I think “prodotto” because the theme is translated in italian, in english “product brand”)

    Also, I checked the structured data and this problem shows up there as well. I paste the code with problem in the Private Content.

    I need to go live on Monday, please, how can I fix it?

    Thank you

    #332967

    Hello,

    The breadcrumbs are the Woocommerce functionality, WoodMart does not inluence.

    Please try to install the free YOAST SEO plugin, it has options to configure the breadcrumbs.

    Best Regards

    #333221

    DanyM
    Participant

    Thank you,
    I solved it with some code in function.php, I paste it here in case anyone might need it:

    function er_woocommerce_get_breadcrumbs($crumbs, $breadcrumb) {
    foreach ($crumbs as &$crumb) {
    $brand = false;
    foreach ($crumb as &$v) {
    if (substr($v, 0, 9) === “Prodotto “) {
    // case index = 0
    $brand = true;
    $v = substr($v, 9);
    }
    if (strlen($v) === 0) {
    // case index = 1
    $brand = false;
    $v = “/brand”;
    }
    }
    }
    return $crumbs;
    }

    add_filter(‘woocommerce_get_breadcrumb’, ‘er_woocommerce_get_breadcrumbs’, 9999, 2);

    #333225

    Hello,

    Thank you very much for sharing the code.

    I am sure it would be useful for other site owners.

    Wish you a wonderful day!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Breadcrumb Brand Schema.org’ is closed to new replies.