admin管理员组文章数量:1405170
I have a custom post type gig
and added the supports Comments but it doesn't show any comment input at all.
$args = [
"label" => __( "Gigs", "understrap" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"delete_with_user" => false,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => [ "slug" => "gig", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor", "thumbnail", "comments" ],
];
For testing purposes, I've only added the following php code in my template:
<?php
comments_template();
?>
This is the output:
<div class="comments-area" id="comments">
</div>
Just an empty comments-area div.
What am I doing wrong over here?
The comments work on the post type post
.
本文标签: phpComments on my custom post type
版权声明:本文标题:php - Comments on my custom post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744886876a2630541.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论