The code below should be something similar to what you’re looking for
Inside the loop template
you use for listing blogs (like index.php
) you need something like this
<a href="<?php the_permalink(); ?>/#respond"> <!-- The blog permalink with the anchor ID after -->
<i class="fa fa-comments-o"></i> Leave a Comment
</a>
Inside your comments.php
file you could have this
<?php if ('open' == $post->comment_status) : ?>
<div id="respond"> <!-- This is the element we are pointing to -->
<!-- Code for comments... -->
</div>
<?php endif; // if you delete this the sky will fall on your head ?>
Related Posts:
- How to auto-approve internal pingbacks?
- Number of External Links in Comments – Moderation Option
- Remove link preview in discussion dashboard
- Add delete, approve, spam Links to Comments
- Get comment content by comment ID
- Changing the comments link produced by the get_comments_link() and get_comments_pagenum_link() functions
- Check if someone recently commented in one of my posts
- cancel reply link results in 404 error
- Change id=”respond” to the comments container
- I wish to remove, disable or hide the comment authors’ links to their sites from my home page
- get_comment_author_link not working properly
- How do I get a array, with the right order of the nested comments?
- Modify links in user comments
- Is there a way to link to the BOTTOM of the comments on a wordpress page?
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Disable Link to Post from Showing Up in Post’s Comments?
- just show the field comment by clicking button
- Commenting in user profile page?
- How to load and show comments with AJAX instead of pagination?
- Reverse comment pagination numbers
- get recent comments of a particular category
- Hook/Filter before and after comments
- WP_Comment_Query() displays “password protected” comments?
- Is it possible to move a comment that should be a reply to another comment?
- Can I seperate comments from post?
- How to show Disqus comments and pingbacks?
- Making a Comment on a page without being on that page?
- Display commenter’s registration date on comments?
- How do I display the commentor’s first name and last name in the comments?
- show un-approved comments at wordpress front end
- How to add consent checkbox in comment section
- How to add pagination to comments?
- Do I have to have a nonce for a custom comment field?
- Get last seen date/time in wordpress get_comments() [closed]
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- How to get replies of a comment?
- Share comment to twitter after publishing [closed]
- changing comment-page-# to something like review-page-#
- Bots posting comments on pages
- default callback function in wp_list_comments
- Why are authors allowed to approve comments on their posts? How to revoke privilege?
- Comments deactivated
- List user comments in author page
- Filter custom posts with / without comments
- Display comments on homepage of twenty seventeen theme
- How to dynamic Heart Like in WordPress?
- Comment Moderation and CDN Caching
- Delete all one-word comments
- Assign author to comment from post edit page
- The “\” is missing when comments is updated
- How to get comment id in callback function?
- Posting comment returns 404
- How-To and Troubleshooting Canonical Links for Paginated Comments
- Comments offset
- How to hide trackbacks on wp-admin/edit-comments.php
- Using a static callback on wp_insert_comment
- How to direct user after comment save
- Show comment pop up links as text only
- How to prevent multiple comments
- Displaying comments on pages distinguished by GET IDs
- Is there a hook to update / replace values in the “Enable threaded (nested) comments x levels deep” drop down?
- Update comment meta for all comments of specific post
- How to change comment texts that has a specific comment_ID – Hook into comment
- Can’t reply to comments [closed]
- counting trackbacks, pingbacks and comments of a post
- Adding comments section to website integrated WordPress instance
- How to Define Custom Number of Items in Comment Feed
- ask and edit an extra comment field
- How indicate when a functions was upgraded in relationship to the entire program [closed]
- Empty comments field or
- infinite loop on page with comments after changing comments.php and header.php
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- Default Gravatar not showing for pings
- How include comment and post count of user in this custom query
- How to filter comments by comment_meta
- Prevent users to delete comments from trash
- How can I hide comment of the authors from their published posts?
- How to customize ‘children comments’ in WordPress?
- How to display replies to his comments in user profile of current user
- Top rated posts Average rating issue
- Disallow Comments
- stop url changing when user comments
- Keep comment author’s name on their comment even when their account is deleted
- WordPress Commenting System User access and Security
- Comments.php is not getting called on main blog page
- Allowing comments on author pages
- Comment section not appearing on posts
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Where is the Leave a Comment link set
- Disable comment moderation in multisite
- Auto disable comments with custom field
- I want to fill the comment with the comment count?
- delete user not working
- Replace do_action() with a normal submit form in comments.php
- How to remove or customize “Comment” in comments form?
- Comments on pages not appearing, even though I enabled them
- check if a comment was made by a registered user
- comment awaiting moderation
- How do you fetch the authors email or IP from /comments? (REST API)
- WordPress Editor widgets “comments” and “post comments form” getting disappeared with elementor [closed]