RM Breadcrums: how to set a max characters limit for last item?

#605139
  • Resolved Matteo Pizzanelli
    Rank Math free

    Hi, my website contains some architectural projects and many of them got a quite long name (more than 100 characters), so my breadcrumbs takes a lot of space since the title is so much long.

    So I would like to limit the lenght of the last element of the breadcrumbs. For example, if the last element is longer than 25 characters I’d like to “cut” the element and show “…” or something like that.

    Can you please help me limit the last element of the breadcrumbs using RM filters and hooks (https://rankmath.com/kb/filters-hooks-api-developer/)?

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for your query. We will be super-happy to help you with your concern.

    One of the easiest ways to do that is to use CSS, try adding this to your theme’s CSS:

    .bbp-breadcrumb-current {
        float: right;
        width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
    }

    If that fails; send us a link to your post where the breadcrumbs appear.

    We hope that helps and we are here should you have any follow-up questions.

    Hi, thank you for your quick reply.

    Honestly I’m not a big fan of CSS solutions and I’d rather use a “real” characters limit in PHP, but I guess for this simple task a CSS solution it’s the right (and easy) fix 🙂
    Thanks again for your help!

    Hello,

    Glad that everything has been sorted out.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

You must be logged in to reply to this ticket.