The if (have_comments()) { ... }
checks whether there is any comment on your post, and starts a loop to display them.
The comment_form()
function is responsible to render the comment form. So, if you want to swap their positions, you should swap these two.
But, you should make sure you move both comment_form()
and its arguments ($comments_args
) above the comment loop, since this variable should be defined first, or the default fields will be used.
The easy way to do this is to select the entire <div id="comments" class="comments-area clear-fix">...</div>
, cut it and paste of below the comment_form()
. Pay attention to PHP open and close tags <?php
& ?>
.
Related Posts:
- Disable comments on all posts/pages
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- Linking to Page Showing Only Comments Without Parent Post
- Comments screen in backend, how to disable email address of commenter for non admins
- How can I limit the number of comments per registered user per day?
- Post Comments using WP REST API v2 in WordPress
- Show content only if member left a comment
- Parent comment’s author name
- get_comments_number of depth-1 (Level 1) (1 post)
- How can I control the comment counts filtering my CPT replies?
- How to auto-approve internal pingbacks?
- Using filter to add additional fields to comment_form()
- Disable wordpress comments API
- List Recent Comments from Across a Multi-site Network
- Can I store my custom comment_type into wp_comments table?
- Number of External Links in Comments – Moderation Option
- What is comment_karma?
- How to override function twentyten_comment
- Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Get most active users sort by comment count
- Passing arguments to wp_list_comments callback function
- What are the additional fields in wp_comments used for?
- Enable Recent Comments widget to display comments on attachment posts
- Change allowed HTML tags for comments
- comments_template not working correcly in custom template files
- Is there any way to override “break comments into pages” and “close comments for old posts” on certain posts, but not on others?
- migrate comments from old database to new database
- Toggle nested comments
- Comments Pagination as an unordered list
- How to get comments from multiple post type?
- Check the Comment in Reply or Normal State
- Is it possible to make wp insert last comment onto another page
- How to allow only Admins or Logged In Users to post links in comments?
- wp_insert_comment error. puzzled by date value
- Private replies for comments
- Show last n comments
- Threaded commenting: how to show threads by last active first?
- edit_comment capability for subscriber
- How to add attributes to the comment form tag?
- How to add replyToUrl schema.org to WordPress comments?
- Get comments from post and sort by commentmeta value
- Yoast makes comment_reply_link function output plain link to comment instead of reply link
- Problems with comments callback (Argument #1 is not an array?)
- Can WordPress comments have titles and taxonomy?
- Do I need to deal with WordPress SQL Injection
- Same email for all comments
- Comments system doesn’t like International domains
- Comments on homepage (index.php) are duplicated under posts
- Email notification to an email address other than admin for custom type post comments in wordpress
- How do I reply to comments from admin panel on a tablet PC?
- Disable comments for a user? [closed]
- Polls with respective comments?
- Why does akismet prevent jetpack comments from appearing in my moderation queue? [closed]
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Comment Link from get_comments()?
- if null or int(0) value to 0
- Problem with WordPress Comment
- Only show own comments in admin panel
- Where are comment ratings stored?
- Comments change the template name
- I can’t post comment via REST API
- WordPress scruity issue – Totally disable all comments by CSS — secure enough?
- Sending comment notifications to different recipients depending on taxonomy terms
- wp_new_comment requires author url and author email
- How to display the user’s comment status on the front end
- get_comments_number() vs. get_post_field( ‘comment_count’, ID )
- Where are comments coded when using custom theme?
- What is the point of get_comment_count() if you cannot limit by a comment type?
- Wrong IP address in comment section
- Comments turned off, but ‘Leave a reply’ link still there [duplicate]
- How to output number of comments with link to comments
- Highlight comments made by registered users of the site
- How do I make Twenty Ten display comments on the home page?
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- Sort post comments from newest to oldest in pagination
- Get all comments associated with a specific page ID (comment_post_ID)
- How do I add custom field to Admin comment form and display
- I would like to count number of comments after 5 days ago
- Using Disqus with headless WordPress setup?
- Attaching author tag to the comment
- Comments counter only for Authors Posts
- How to show a “Comments Are Closed” message on posts where comments have been closed?
- Necessary to have a comments.php if there are no comments?
- Comments pagination on author page
- Inserting comments via a procedure
- transition_comment_status gets called when untrashing comments
- How can I have a full comments.php for an easy editing of all its aspects?
- Transfer comments from one domain to another
- WordPress is adding above html
- Passing user meta through comment form
- How do I separate author avatars and comments in 3.4.2?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- Display DISQUS on homepage
- How to stop a specific person to comment on my blog? [closed]
- Query comments with non-empty ‘author_url’ value on Admin Comments Screen
- Customize the new comment notifications sent to the post author after the comment is approved
- Get approved comments or comments that the author is me