0

I'm using wordpress API to display content. I'm using the classic editor since guttenberg is bugging out elsewhere.

I noticed that if a paragraph does not have inline styles, wordpress does not save the <p> tags in the database. So when I call the api, the response is something like this:

first paragraph.

second paragraph.

There isn't even a <br> tag in between, just a newline I believe.

I just need to style paragraphs to be spaced apart, so I would prefer to have the paragraph tags.

Looked into wpautop function, but i just does not seem to save paragraph tags unless I tweak inline styles.

Any suggestions or alternatives?

2
  • WordPress doesn't save the <p> tags in the database, but they should be added in API responses. How are you retrieving the content? Commented May 28, 2019 at 23:46
  • It's an API call. I guess I forgot one detail - this is for a custom taxonomy description. I re-checked and it seems that for pages it does save correctly.
    – geochanto
    Commented May 29, 2019 at 0:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.