微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我启用了允许对我的自定义帖子发表评论,但评论没有显示在我的帖子页面上

如何解决我启用了允许对我的自定义帖子发表评论,但评论没有显示在我的帖子页面上

我有一个 wordpress 问题。我在 mu-plugins 中启用了评论<?PHP function al_post_types() { register_post_type('quote',array( 'show_in_rest' => true,'map_Meta_cap' => true,'public' => true,'supports' => array('title','editor','excerpt','comments'),'has_archive' => true,'labels' => array( 'name' => 'Quotes','add_new_item' => 'Add New Quote','edit_item' => 'Edit Quote','all_items' => 'All Quotes','singular_name' => 'Quote' ),'menu_icon' => 'dashicons-format-quote' ));

并已启用对单个帖子的评论管理面板中“讨论”中的评论也已启用,我尝试通过禁用它们然后再次启用它们来启动它们。然而在我的带有 url biblicalquotes 的 page.PHP 上,评论没有显示出来。我已将我的 biblicalquotes 设置为帖子页面,并通过 URL 中的 biblicalquotes 链接到它。这是我的 page.PHP:

`<div class="row">
<br/>
<br/>
<?PHP
$today = date('Ymd');
$homepageQuotes = new WP_Query(array(
'posts_per_page' => 4,'paged' => get_query_var('paged',1),'post_type' => 'quote','orderby' => 'Meta_value_num','order' => 'DESC','date_query' => array(
'after' => array(
'year' => 2021,'month' => 4,'day' => 21
)
)
));
            
while ($homepageQuotes->have_posts()) {
$homepageQuotes->the_post(); ?>
<div class="col-xs-4 col-sm-4 col-lg-4 col-xl-4">
<a class="speciala" href="#"><?PHP $quoteDate = new DateTime(get_field('biblical_quote_date')); echo 
$quoteDate->format('M') ?>
<?PHP echo $quoteDate->format('d') ?></a>
<li id="Bibtitle"><span><?PHP the_title(); ?></span></li> 
<br/>
<div class="myquotes">
<?PHP echo get_the_content();  ?>
</div>
</div>
     


<?PHP }

?>
<div class="col-xs-4 col-sm-4 col-lg-4 col-xl-4">
</div>
</div>`

为什么我在线查看网页 (page.PHP) 时不显示评论框?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。