Home Forums WoodMart support forum Changing Breadcrumbs to default to shop instead of home

Changing Breadcrumbs to default to shop instead of home

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #472916

    deals2023
    Participant

    When you browse a product page, by default, in breadcrumbs, the first thing that appears is home
    I don’t want home to appear in breadcrumbs
    I want shop instead of home
    That is, on a product page, the first thing that will appear is shop
    And that there will be no home in breadcrumbs

    How do you do that?

    Attachments:
    You must be logged in to view attached files.
    #473011

    Hello,

    The breadcrumbs take the page titles. If you want to change Home > Shop just change the page titles. At the same time, it is not possible to change the breadcrumbs without changing the titles. It requires customization and this is beyond our limitations and support.

    You can check the breadcrumbs for the product page from Theme Settings >> Product Page>> Elements.

    Best Regards.

    #473020

    deals2023
    Participant

    Hi, I don’t want to change the names, but the path.
    I mean right now it’s like this:
    Home Page -> category -> Product page

    and Home Page links to https://www.top5-deals.com/

    And I want it to be like this:
    Shop -> category -> Product page

    When Shop will refer to:
    Shop = https://www.top5-deals.com/shop/

    So how do I do it?

    #473241

    Hello,

    WoodMart does not have the option to modify the breadcrumbs, unfortunately. There are two kinds of breadcrumbs in our theme: one comes from the WooCommerce plugin and one from WoodMart. If you want to customize one of our theme’s one, you need to edit the file: inc/template-tags.php.

    For the breadcrumbs changes, you can also try to use the Yoast SEO plugin and it’s breadcrumb option:

    https://yoast.com/features/breadcrumbs/

    Best Regards.

    #607914

    barry-6678
    Participant

    @deals2023 did you ever find a solution to this?
    I too find it really annoying and hope Xtemos has made a change / option to change the default “HOME” to the shop.
    I.e. when a user is shopping in categories, they dont want to go back to the home page, but to the front of the shop.

    Is there any solutions you found?

    #607964

    Hello @barry-6678,

    Navigate to Settings > Permalinks > Choose Product Permalink “Shop base with category” and check the issue.

    Best Regards

    #679668

    fb.com/only0nce
    Participant

    If you don’t want to use that “Shop base with category” option, you can paste it into Woodmart>Themesetting>Custom JS if you still want to keep short-easy-to-remember permalink of your category or product to giving out to customer easier. I made this using gemini AI, please change your “YourWebsiteDomain”, “shop”, “Home” accordingly to yours

    (function() {
        'use strict';
    
        // This is the core function that will apply the breadcrumb changes.
        function applyBreadcrumbChange() {
            // First, apply the primary change to the first breadcrumb link.
            const firstLink = document.querySelector('.wd-breadcrumbs a');
            if (firstLink) {
                // Only change the link if it's not already the target URL
                if (firstLink.href !== 'https://YourWebsiteDomain/shop') {
                    firstLink.href = 'https://YourWebsiteDomain/shop';
                    firstLink.textContent = 'Home';
                }
                
                // Now, check for and remove the duplicate breadcrumb.
                const lastBreadcrumbSpan = document.querySelector('.wd-breadcrumbs .wd-last');
    
                // The check is performed after the change to the first link.
                if (firstLink.textContent === 'Home' && lastBreadcrumbSpan && lastBreadcrumbSpan.textContent.trim() === 'Home') {
                    const delimiter = firstLink.nextElementSibling;
                    firstLink.remove();
                    if (delimiter && delimiter.classList.contains('wd-delimiter')) {
                        delimiter.remove();
                    }
                }
            }
            
            return false;
        }
    
      // Use a failsafe interval to re-apply the fix every second.
        // This will catch cases where the observer might miss a change.
        setInterval(applyBreadcrumbChange, 1000);
    })();
    #679799

    Hello @fb.com/only0nceParticipant,

    Thanks for sharing the solution—it’ll be helpful for others too.

    Best Regards

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