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