Short answer: you can’t.
Longer answer:
You can include comments.php
as a template-part file inside another template, via:
get_template_part( 'comments.php' )
…but that won’t actually make comments work, because the comments_template()
template tag does far more than merely include the comments.php
template-part file. In order to make comments actually work when using get_template_part()
as opposed to comments_template()
, you’d need to duplicate all of the functions performed by comments_template()
. And if you need to duplicate all of that code in order to make comments work, you might as well just use the function itself.
Related Posts:
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- How to enable comments for pending and draft posts?
- Comments not appearing at all
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Reverse comment pagination numbers
- Comment Count for each Comment Author
- Show comments from multiple post IDs in comment template
- Sticky Comments
- Whitelisting Commenters
- WP_Comment_Query() displays “password protected” comments?
- Comments number message in password protected post
- Disable Comments Feed
- Use rich text editor in comments?
- Add a custom class to awating comments
- How to add custom comment fields but *only on the comment reply form*?
- Is it possible to move a comment that should be a reply to another comment?
- Show only posts which can be commented
- What should I hook to add extra fields to comments?
- Get a variable field of all comments of current post
- Average Score of all ratings in comments
- Making a Comment on a page without being on that page?
- How do I display the commentor’s first name and last name in the comments?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, func
- How To Disable Comments On New Page
- What is the server IP comment hack
- Do I have to have a nonce for a custom comment field?
- Get last seen date/time in wordpress get_comments() [closed]
- Report spam button
- Recent comments from my blogs only
- Why is comments_template() working without a comments.php file?
- Comment form connection to Gravity Forms
- Add classname comment template from functions.php
- Comments deactivated
- Reject Comments Based on Author Email
- List user comments in author page
- Turning off trackbacks & comments
- Filter custom posts with / without comments
- Create comments.php form of custom HTML code
- Display comments on homepage of twenty seventeen theme
- Disqus comments and pingback script – how to change the order?
- To whom do emails get sent via the WordPress comments form?
- Is it possible to embed github gists in wordpress comments?
- Comments feed – Undefined named entity: ndash
- warnCommentChanges always being triggered on update
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- Why do I have to manually approve comments from one of my users who already has an approved comment?
- how get comments only on post of current logged in user?
- How to get comment id in callback function?
- Posting comment returns 404
- How to convert WordPress comments to bbPress replies [closed]
- Get declared variable in single.php to work in comments.php without re-declaring it [closed]
- What is causing wp-comments-post.php to redirect to the browser’s IP address?
- Extra Title field for Comments
- Comments offset
- comments_number not displaying
- Get comments only for certain specific users in template file
- Using a static callback on wp_insert_comment
- Insert Ads “into” comments section in Genesis Themework
- WordPress Recent Comments Widget exclude own comments
- How to prevent multiple comments
- How to get comment images stored as serialized comment meta
- Hide comments on specific pages, not just disable future comments
- How to permanently delete pages I have already trashed?
- Additional content every x comments
- How to display category name from commenter’s custom post
- Add comment_meta to wp_comment_reply
- How do comments work?
- Can’t reply to comments [closed]
- What’s the difference with trash_comment and wp_trash_comment?
- How can i change the order of comments?
- ask and edit an extra comment field
- Refresh individual comment text via API
- How to filter comments by comment_meta
- Prevent users to delete comments from trash
- How to display replies to his comments in user profile of current user
- How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?
- Top rated posts Average rating issue
- Need to output comment_form() function inside a foreach loop
- stop url changing when user comments
- Comment field override
-   not working in comments
- Badges for Guests based on their comment counts [closed]
- How to add a class to comment submit button?
- WordPress Commenting System User access and Security
- WordPress Comments – Only show part of user name
- URLs to user page is broken
- Comments Template shows, but not the comments
- Broken comments section – WordPress 2014 Theme
- Need an advice about comments
- Force logged in users to provide more data when commenting
- How do I get the comments section to show up?
- By Default, Turn Comments Off for Pages & Leave Comments On for Posts
- same comment list for two posts
- Replace do_action() with a normal submit form in comments.php
- Getting thousands of spam comments
- edit-comments.php in Admin – how to change ‘Comments’ title?
- Comments on pages not appearing, even though I enabled them
- Stop future commenting on specific post
- comment_approved custom value