Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを使用して、特定の投稿 (この場合は 103) の内容を出力しています。
<?php $post_id = 103; $queried_post = get_post($post_id); echo apply_filters('the_content',$queried_post->post_content); ?>
<p>やなどのすべての html タグを除外して<br>s、テキストのみを表示するにはどうすればよいですか?
<p>
<br>s
ありがとう!
strip_tag(string) 関数を使用して、文字列からすべての html タグを削除します
echo strip_tags(apply_filters('the_content',$queried_post->post_content));