the answer for all question about Oxygen Builder plugin and WordPress

[SOLVED]


[SOLVED]

Anwar Jacobs’ suggestion was super helpful! Check it out…

[ORIGINAL]

So, a bit of help is needed 😊 I have a repeater set to display 5 latest posts (it outputs post titles with a link) but I need to character limit the post titles. Can’t figure out how to do this…

Maybe have a code snippet that takes the repeater output and then sets the character limit on it with a filter? Thanks, would appreciate some help or guidance… 👍😎




Source

5 Comments
  1. Davor Mlinarić says

    maybe with css ellipsis? or php echo mb_strimwidth(get_the_title(), 0, 50, ‘…’);

  2. Joel Male says

    Code block, use “the_title()” or similar function, and use php to limit the string

  3. Martin Tenev says

    I have had similar issue with long titles and instead of character limiting the titles I used text-overflow – ellipsis. It works great as you don’t have to specifically set the character count and it also adapts very nicely with different screens. Take a look at MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow). It might not be for you but just an option to consider. If you decide to go with this option keep in mind that in order to get it to work with Oxygen for some reason you have to copy the css rules to the text element as well as the child span element. Good luck.

  4. Anwar Jacobs says

    Code snippet
    /**
    * Custom title length.
    *
    * @param int $limit The number of words.
    */
    function title( $limit ) {
    return wp_trim_words( get_the_title(), $limit );
    }

    Insert Dynamic Data > Advanced > PHP Function Return value, 3 is the number of words.

  5. Jon Gorman says

    try this:

Leave A Reply

Your email address will not be published.

Oxyrealm Docs