Support

Account

Home Forums Front-end Issues Get each paragraph from acf WYSIWYG field

Helping

Get each paragraph from acf WYSIWYG field

  • Hi!

    I would like to get (then add custom class) each paragraph (p) from acf WYSIWYG field. Is it possible ?

    I already tried get_sub_field('text', false, false) but it doesn’t work since I have multiple “p” in my field and I need to separate them.

    Thank you for your help!

    (Sorry for my English, I’m not fluent..)

  • There isn’t any way to do this without parsing the returned text using a regular expression or otherwise parsing the returned string.

    My suggestion would be to use a container div that has a class and target the paragraphs in it.

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

The topic ‘Get each paragraph from acf WYSIWYG field’ is closed to new replies.