• Resolved coldxot

    (@coldxot)


    Hi there, long time user of TSF in need of help with breadcrumbs.

    Using the shortcode to implement them on my blogs works.. and with some CSS I got them to display reasonably nicely.

    My issue is getting them to center, and most importantly look nice on mobile. I’ve tried to accomplish this wish CSS but have been stumped so far… ending up with a rather choppy looking design.

    Even on desktop things are off center.

    I cannot find any documentation on this via search so any help is appreciated.

    Screenshots:

    https://ibb.co/1mDYN38
    https://ibb.co/hLsJY4m

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I recommend making the font size smaller or applying text-wrap: balance if the builder allows this (https://developer.chrome.com/docs/css-ui/css-text-wrap-balance).

    If you provide me with the URL of the affected page, I can offer more detailed guidance.

    Thread Starter coldxot

    (@coldxot)

    Hey Sybre, I appreciate the quick response. I tried to figure out the text-wrap:balance but was not able to accomplish much with that to fix the issue.

    Still working on the website but opened it up for you to take a look here


    https://questiontravel.com/portugal/portimao/the-beauty-of-the-soematra-forest-stories/

    A fix would be very appreciated to ensure breadcrumbs can be used and displayed nicely.

    Plugin Author Sybre Waaijer

    (@cybr)

    Howdy!

    Thank you for the URL. I think I came up with something good.

    For your site, I recommend adding the following CSS. It transforms the breadcrumbs into flexboxes so that each crumb’s entire text can break/wrap to the next row.

    I also removed the extraneous padding from the theme styles. I didn’t consider padding to be used instead of margins for list elements.

    nav.breadcrumbs ol {
        display: flex;
        flex: 1 1 auto;
        flex-flow: row wrap;
        justify-content: center;
        padding-inline-start: 0;
    }

    Also, because the current page title is displayed right above the breadcrumb title, I think it’s best to hide it.

    nav.breadcrumbs ol li:last-of-type,
    nav.breadcrumbs ol li:nth-last-child(2):after {
        display: none;
    }

    I hope you like it! Cheers πŸ™‚

    Thread Starter coldxot

    (@coldxot)

    Hey Sybre,

    You are awesome – I appreciate the in depth assistance here.

    Though this didn’t seem to fix the issue, it kind of just shoved everything over to the left on mobile.

    It did seem to work if I add the 2nd part to remove the page title, but only if it is small enough to fit on one line. As soon as it breaks into 2 lines on mobile it gets shoved off to the left.

    Screenshot: https://ibb.co/XDpZGMc

    Left the site live too so you can see it with the code applied.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi again!

    To me, it appears that the code isn’t applied at all. Have you tried flushing the caches?

    Be sure to add both CSS snippets I shared in my last reply for the full effect.

    • This reply was modified 2 years, 2 months ago by Sybre Waaijer. Reason: More info
    Thread Starter coldxot

    (@coldxot)

    Hi there,

    Yes, I have cleared the cache and the code is applied. It does everything expected except center the text on mobile, it instead moves it to the left.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I see that TSF’s original CSS is added after the modifications, creating specificity issues and rendering their centering ineffective.

    I cannot tell what’s happening precisely because a plugin extracts all the CSS and dumps it into the header, indiscriminately of context and scope. Such optimizations create weird bugs, and it was probably why the first attempt at adding the CSS didn’t appear to work: layered optimizations create caching issues.

    In any case, here’s the updated CSS to mitigate the specificity issue, specifically for Elementor’s shortcode element and shortcode [tsf_breadcrumb class="breadcrumbs"]:

    .elementor-shortcode nav.breadcrumbs ol {
        display: flex;
        flex: 1 1 auto;
        flex-flow: row wrap;
        justify-content: center;
        padding-inline-start: 0;
    }
    
    nav.breadcrumbs ol li:last-of-type,
    nav.breadcrumbs ol li:nth-last-child(2):after {
        display: none;
    }

    Remember to flush your site’s caches after updating the snippet. Let me know if this resolves the issue. Cheers!

    Thread Starter coldxot

    (@coldxot)

    Hello again,

    Thank you for your efforts here, sincerely appreciated.

    The new code did not work at first but your point about a plugin led me to investigate further whether my caching plugin (WP Rocket) was for some reason causing a conflict, despite the cache being fully flushed each time.

    I deactivated the plugin fully and activated one setting at a time to try and determine the cause. I ended up back to my original settings and the code continued to work this time around. Odd situation but it works now!

    Thank you again.

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

The topic ‘Styling Breadcrumbs’ is closed to new replies.