How Do I Add Comments to a Custom Post Type in WordPress?
Adding comments to a custom post type can be a daunting task for new WordPress users. In this article, we will walk you through the process of adding comments to a custom post type in WordPress.
First, you will need to create a new custom post type in WordPress. To do this, go to your WordPress admin area and select “Posts” from the left-hand menu. Then, click on the “Add New” button and enter the following information into the “Post Type” field:
Name: Comment
Description: Comments for the Comment post type
Once you have completed these fields, click on the “Save” button to save your new custom post type.
Next, you will need to add a comment form to your custom post type. To do this, go to your WordPress admin area and select “Appearance” from the left-hand menu.
Then, select the “Editor” tab and click on the “Add New” button. Enter the following information into the “Form” field:.
Name: Comment Form
Description: Comment form for the Comment post type
Once you have completed these fields, click on the “Save” button to save your new comment form.
Next, you will need to add a post type taxonomy to your custom post type. To do this, go to your WordPress admin area and select “Taxonomies” from the left-hand menu.
Then, select the “Post Type” tab and click on the “Add New” button. Enter the following information into the “Taxonomy” field:.
Once you have completed these fields, click on the “Save” button to save your new taxonomy.
Finally, you will need to add comments to your custom post type. To do this, go to your WordPress admin area and select “Comments” from the left-hand menu.
Then, select the “Post” tab and click on the “Add New” button. Enter the following information into the “Comment” field:.
Title: My Comment
Body: My comment for the Comment post type
Once you have completed these fields, click on the “Save” button to save your new comment.
Now that you have added comments to your custom post type, you will need to add a reference to it in your WordPress theme.
Then, select the “Editor” tab and click on the “Appearance” link next to your WordPress theme. Finally, select the “Custom Fields” tab and click on the “Add New” button. Enter the following information into the “Field” field:.
Name: Comment Type
Value: Comment
Once you have completed these fields, click on the “Save” button to save your new reference to your comment type.
Now that you have added comments to your custom post type, you are ready to add a reference to it in your WordPress theme.
Now that you have added comments to your custom post type, you are ready to use them in your WordPress blog. To do this, go to your WordPress blog and select a post from the Posts list.
Then, click on the “Comments” link to open the comment form for that post. Finally, enter your comment into the comment form and click on the “Submit” button to submit your comment.