Thread Starter
John
(@dv1961)
Thanks for getting back to me. I’m not clear what you mean. As well as creating the post type (with plugin) I need to do more?
As far as I understand you, you have created a custom post type and want to activate the “closing of comments after 14 days” provided by WordPress. To do this, you must use the above hook to integrate your custom post type in the auto-close feature. It should look something like this:
add_filter( 'close_comments_for_post_types', function( $list ) {
$list[] = 'your_post_type';
return $list;
});
You must of course replace “your_post_type” with the slug of your custom post type.
If you have created the custom post type with a plugin, you have the option of either storing the above-mentioned code in the functions.php of your child theme or using a code snippet plugin OR asking the support of the plugin you used to create the custom post type for help.
Thread Starter
John
(@dv1961)
Thanks very much, that’s completely clear. I’ll paste the snippet into code snippets.
(@dv1961)
2 years, 10 months ago
I’m using a custom post and I have ‘Automatically close comments on posts older than’ set at 14 days, the default, ticked. But comments never close. Is this to do with it being a custom post type? Or something else?