admin管理员组文章数量:1289556
I am using a plugin which shows posts from specific category in a widget.
It has an option to show excerpt and the below code is used for that:
<?php echo $post['excerpt'] ?>
But I want to show full posts instead of excerpt.
I tried the_post
, the_content
instead of excerpt
in the above code but none working.
Can you please let me know what I am doing wrong?
I am using a plugin which shows posts from specific category in a widget.
It has an option to show excerpt and the below code is used for that:
<?php echo $post['excerpt'] ?>
But I want to show full posts instead of excerpt.
I tried the_post
, the_content
instead of excerpt
in the above code but none working.
Can you please let me know what I am doing wrong?
Share Improve this question asked Jun 27, 2021 at 10:17 JituuJituu 314 bronze badges 1 |1 Answer
Reset to default 0You should use this (because the content saved in the post is unfiltered):
echo apply_filters( 'the_content', $post->post_content );
However, be advised that you should not alter code of plugins or themes that are not created by you. If that plugin is updated, your altered code is probably gone. For themes, you could create a child theme, but for a plugin, you might want to create your own. Creating a simple plugin that creates a widget that displays posts from a category is not too difficult.
本文标签: phpShow full post instead of excerpt
版权声明:本文标题:php - Show full post instead of excerpt 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741477959a2380996.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
$post
for example and how'd it get there? – Paul G. Commented Jun 27, 2021 at 12:33