You can use the comment_form_defaults
filter to change your text based on custom post type. Just check the post type in your filter function.
For example:
add_filter( 'comment_form_defaults', 'my_comment_form_defaults' );
function my_comment_form_defaults( $defaults ) {
if ( 'my_cool_custom_post_type' == get_post_type() ) {
$defaults['title_reply'] == 'My Custom Post Type Comment Title';
}
return $defaults;
}
If you need to change various elements of the defaults, see where $defaults
is defined just before the filter hook is applied in the source here: https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/comment-template.php#L2429
Rather than load a different comments.php based on post type, you could potentially use some switch()
or if()
logic based on get_post_type()
to display differently based on the requested post type.
Related Posts:
- Why are the comments disabled by default on my custom_post_types?
- Why are comments and trackbacks still getting through for custom post types?
- Display Authors Comments on Profile Page
- List all posts commented by current user
- Custom Comment Types
- modify all posts of a category to “no comments allowed”
- Custom comment status possible?
- feed links for custom post type pages
- Seperating custom post type comments from regular blog posts comments
- Add comments meta fields to comments metabox on post edit screen
- Exclude post_type from admin comments_list
- Recent comments on author page?
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- Comment moderation on custom post types
- Automatically check “Allow comments” for custom post type [duplicate]
- How could I create a ‘private comments’ section on a custom post type?
- Disable comments from showing up public for Custom Post Type
- Custom Post Type loops and Disqus
- “Allow Comments” box cannot be checked
- Separate comment section for post type in dashboard
- Count all comments of a custom post type
- custom comments on specific post type
- Insert data on comment post
- get_comments not working on custom post types
- Custom Post Type Set Comments ON by default without show METABOX
- WordPress comments_open for specific user role or post type
- Add custom field in comments form
- Create another comment system for CPT
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Convert comments to Custom Post Type
- How to assign classes to all elements?
- custom comments form for custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- comment_notification_text filter for custom post type
- get comments by current user inside page template
- User-submitted reviews of different custom post types
- Check if user has comment on current post
- Enable comments on custom page type – option not showing in “customize” for theme
- Allow anonymous comments just in a custom post type
- duplicate comment section functionality and call it something else for custom post types
- Send email messages after comment was submitted
- comments hooks on custom post type
- custom comment fields on CPT
- unapprove comments on custom post type
- Enable comments for post when comments meta box removed
- Get the latest comment from a custom post type where depth = 1?
- Why will comments not remain open on custom post types?
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- Comments on posts with new custom post type redirected to another post
- Display custom posts, ordered by most commented, without duplicates
- get comments for custom post type
- How to create a discussion post when a custom post is created?
- Adding second comments.php for reviews
- Custom post type updated to support comments, yet comments don’t appear
- Comments not enabled for custom post types
- Turn off comments for given CPT checkbox?
- Author profile comments system
- Custom post type: can’t enable comments by default
- Comment moderation with disqus comments
- add comments custom fields after user is logged in
- Comments are not working on Custom Post Type
- Error 403 when posting comments to a custom post type from a different page
- Comments not working (error not allowed) on posts with custom post status
- How to get custom post type post id from slug?
- How to show Y number of custom posts after every X normal posts?
- Custom post types vs post formats : future-proofing – is one less “future proof” than another?
- create a mostly read only CPT
- Refine custom posts by author
- Post type archive page not working
- Unable to filter on field on edit.php page
- Help with hierarchical custom taxonomies and permalinks…almost there
- How to get only one category of custom post type?
- Adding posts of custom type into the main feed
- Changing the header on post listing page in admin area
- Get random custom posts from a custom post type
- Custom template won’t load for a custom post type (custom permalinks used)
- Custom post type and taxonomy – show related posts
- is_post_type_archive is false when I pass GET parameters in the URL
- CPT post count is 0 for the authors in the User list
- Display Child Pages of Custom Post Type Parent Page
- Why isn’t my custom post type archive URL translating?
- How to change path for default WordPress blog posts?
- How to Echo Metadata Value in Currency Format
- How does: /index.php?post_type=event&event-date=2011-07-25 work? What if it doesn’t work?
- Getting post attchment URL to populate a CPT Admin Page Column
- Pagination doesnt work in custom post type
- Custom Post Types and Removing Slugs – should we do it?
- WordPress admin for a custom post, hide/collapse the main “title” and “description” boxes
- Custom Post Type Child Won’t Come Through With Pretty Permalinks
- Use custom post type taxonomy between cpt slug and name
- How can I add a URL link to my post type?
- Accessing download link from the loop with WP Download Manager Pro
- How to sort post category using its Description
- Add class attribute in Custom Post Type
- Prev / Next Post Same taxonomy Custom Post Type
- update flamingo_inbound post type after insert
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Modifying and Displaying URL’s in a Post Template using parse_url
- Changing to different post type maintains the redirection?