I have a custom post type and I want to create 2 new fields and remove the default ones (author,url,email) without affecting the default comment fields inside the blog posts.
Also I want to make it visible just for logged in users, with a message like this for non-logged in users:
You must be logged in to post a comment
I’ve noticed that I can do this from the dashboard setting but the problem is that this will be applied to all the comments and I want to apply this just on a specific CPT.
This code is removing the default fields also on the blog posts and I don’t want this.
After I submit a comment inside my CPT I get this: ERROR: please fill the required fields (name, email).
And also how can I add a message if the user is not logged in like this:
You must be logged in to post a comment
just on my CPT.
The topic ‘custom comment fields inside custom post type’ is closed to new replies.
(@dynamyc)
12 years, 6 months ago
I have a custom post type and I want to create 2 new fields and remove the default ones (author,url,email) without affecting the default comment fields inside the blog posts.
Also I want to make it visible just for logged in users, with a message like this for non-logged in users:
I’ve noticed that I can do this from the dashboard setting but the problem is that this will be applied to all the comments and I want to apply this just on a specific CPT.
So, here is my approach:
This code is removing the default fields also on the blog posts and I don’t want this.
After I submit a comment inside my CPT I get this:
ERROR: please fill the required fields (name, email).And also how can I add a message if the user is not logged in like this:
just on my CPT.