Display html code, not the tags

admin2025-06-02  0

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?

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?

Share Improve this question asked Mar 3, 2019 at 10:00 netdevnetdev 1052 silver badges6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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'] ) );
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748846393a314213.html

最新回复(0)