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