admin管理员组文章数量:1414621
Currently I have a post with <strong>
and <em>
tags, and <p>
tags. But they all seem to be being outputted as plain text, and not formatted HTML
I am using laravel blade as my templating engine. I currently have:
@php
$page = get_page_by_title( 'Test Page' );
$content = apply_filters( 'the_content', $page->post_content );
@endphp
Which outputs:
<p>This is a test page for development practice.</p> <p>Here is another line etc</p> <p><strong>BOLD TEXT</strong></p> <p><em>ITALIC TEXT</em></p>
When it needs to be:
This is a test page for development practice.
Here is another line etc
BOLD TEXT
ITALIC TEXT
This answer:
How to output only the post content suggests to use apply_filters( 'the_content', $post->post_content );
which is what I'm currently doing
how do you have content outputted as HTML and not plain text?
本文标签: filtershow to output HTML tags in postcontent and not as plain text
版权声明:本文标题:filters - how to output HTML tags in post_content and not as plain text 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745188356a2646790.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论