How to limit the characters to display on front end

Support General How to limit the characters to display on front end

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39482
    picatabaibospicatabaibos
    Participant

    Hi,

    I'm using Oxygen builder and I have a custom field WYSIWYG (text) that I want to display on front end but I need to limit the number of characters to display.

    I'm aware I'll need a function to get the field value and output the value with character limit but I don't know how to apply all of this on Oxygen builder.

    I've searched on the forum but couldn't find what I'm looking for.

    Can you guys help me here?

    I really appreciate it!

    #39484
    picatabaibospicatabaibos
    Participant

    I forgot to tell that I'm using a repeater to get a custom post type "News" with the mentioned custom field and other fields too like a photo.

    #39505
    PeterPeter
    Moderator

    Hello there,

    When outputting the field value with code, you can use the WordPress function wp_trim_words() to trim text to a certain number of words or use the PHP function substr() to return a number of characters.

    Read more on the documentation https://docs.metabox.io/fields/wysiwyg/#template-usage

    If you use the Oxygen builder, you can contact their support to get further assistance.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.