Closed MorganAkki closed 6 years ago
Not really. By default, the post_content
property is only holding a large string. It is through WordPress/PHP helper functions that some HTML tags and shortcodes are "compiled".
You can use the WordPress filter content
so it behaves like on default templates:
{{ fn.apply_filters('content', post.post_content)|raw }}
This filter already exist or do I have to create it ? Because it does'nt work in my case. Did I miss something in my theme configuration ?
Or perhaps it is the_content
for its name. Yes it is a core filter used by WordPress. Used into the the_content()
template function for example.
Perfect! Thank you for your help 👍
Hello,
In my template I use
{{ wpautop(post.post_content)|raw }}
to display the content of my page. But HTML from shortcodes are not display. I also tried wptexturize(). If I add{{ wpautop(fn.do_shortcode(post.post_content))|raw }}
, it works.Is there a better solution? Thank you for your help.