I am using a theme and I want to modify it in order to use html code in a text field.

This is the part of the code that renders this field:

do_shortcode( wpautop( esc_html( $sectionData['left-content'] ) ) )

I want to modify it in order to display html code properly, but it keeps rendering the tags and not the formatted text.

I want to display this but it displays <b>this</b>. How I can modify it?

1 Answer 1


You need to remove the esc_html(). The whole purpose of that function is to prevent text being interpreted as HTML.

do_shortcode( wpautop( $sectionData['left-content'] ) );

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.