It’s strange that you want to use comments pagination where the comment links are without the comments pagination base.
But you can try this (untested):
/**
* Remove the comments pagination base from comments links
*/
! is_admin() && add_filter( 'get_comment_link', function( $link, $comment, $args )
{
if( $args['per_page'] )
$link = sprintf( "%s#comment-%d",
get_permalink( $comment->comment_post_ID ),
$comment->comment_ID
);
return $link;
}, 10, 3 );
Another option would be to replace it with something like:
$link = preg_replace( '%comment-page-\d+/%', '', $link );
where the base could be dynamically fetched with:
global $wp_rewrite;
if ( $wp_rewrite->using_permalinks() )
$comments_pag_base = $wp_rewrite->comments_pagination_base;
Related Posts:
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- How to use a custom comments template
- Comment visibility
- Get comments for more than one post
- Allowing more elements in comments via functions.php
- Set post comments open function
- “Categories” for comments?
- Allow anonymous comments, but prevent spam [closed]
- Where to remove from comment’s feed?
- Allow guests comments on single post
- Delete all user comments
- Why do I get email notifications about comments that WordPress has already determined are spam?
- Delayed commenting
- “Leave a comment” link even when you can’t
- An action hook where a comment meta is updated
- Display number of comment replies
- User can post only one comment per day on one page
- Last comment page first with full number of comments?
- Only subscriber role user can comment not other
- customize comment form
- Relaxing unescaped HTML filtering inside tags?
- WordPress comments email notification for authors
- How to get the result of comments_number() as a string instead of printing it out?
- Should I still worry about paginated comments with the latest wordpress versions?
- How to dont allow registered users to comment without being logged in?
- edit comments capability for authors
- Publish a message on facebook after having posted a comment
- Users with custom roles can’t read each other’s comments
- Why is_wp_error() is not returning false even there’s no defined error
- wp_insert_comment and security
- How can someone submit a comment when my site has no comment field?
- Separete trackbacks/pings and numbered comments
- How can I fix wp_insert_comment failure when ‘comment_content” includes slanted apostrophe in Excel csv source data
- Show comments in a popup
- highlight “starred” comments by admin
- How to display html in only the first level of WP comments?
- Set noindex page-comment from Pages 2, 3 and More?
- How can I convert anonymous commenters into registered users?
- your comment awaiting moderation message sometimes not appearing
- Limit comments per user per post
- Filter In Reply comments from WordPress Admin Panel
- Comments vs. Pingbacks next page issue
- WordPress ‘comment counts’ got messed up, because of a plugin – DISQUS
- blank page after submitting a comment
- Remove post navigation links
- Display only 1 comment and then option to show more
- Notify post author for a new comment on his post?
- cancel reply link results in 404 error
- css hide all the comment reply links except the lowest nested comments
- Prioritizing the wordpress comments
- Which filter/hook to use for styling comments?
- How should I get the original comment while processing the reply
- How to override wp_insert_comment()
- I wish to remove, disable or hide the comment authors’ links to their sites from my home page
- Admin can enter JavaScript – potential security risk?
- How to stop ultimate members to redirect comment authors to user profile?
- Replace comments with a dummy text
- How modify the comment content persistently based on $wp_query?
- Displaying Posts Depending on Number of Comments and Latest Comments?
- How do I stop the comments going to my email?
- Disable only the comment form/box itself?
- How to implement just the wp commenting area on my custom site?
- anyone can help me to know whats going wrong? [closed]
- Why there is still an approved comment after deleting all?
- Get comment id of the individual comments in comment list when modifying comment posted using comment text filter
- Custom comment field not showing when logged-in
- Comments on future posts
- Display custom text when comments are closed
- I need to disable Disqus comments pre-approval, but i can’t find where
- JetPack comment threads are displaying above comment box? [closed]
- How to Trigger comment_form_after action if comment_form() not used
- Need Comment Link Help
- Page comes up blank using w3 total cache [closed]
- Comment Table Size Results in Slow Page Loads and 500 Errors
- Insert ads between comments
- get_query_var(‘paged’) for WP_Comment_Query always return 1 when using paginate_comments_links()
- How to show username in reply to comment?
- Custom sort comments with select form
- Subcriber getting multiiple notifications for new comments
- Limit Comment Line Count – Add Read More Button
- Commenter username copies author username
- Fire Social Annex Code on Comment Approval
- Displaying comment rating stars in carousel
- Enable comments option
- Change Comment Text [duplicate]
- Comments closed but enabled on edit screen
- Let user delete comment on front end only
- How to force users to nest their comments
- jQuery to Create Button to Show/Hide WordPress Comments and to Hide Comments by Default
- Insert comment and still use moderation
- Auto approve all comments (editor)
- add field comment [duplicate]
- Let users comment on categories in WordPress
- Loop not displaying comments_popup_link
- Display of comment_date within get_comments?
- Customize comment notification e-mails with HTML
- prevent duplicate comments using wp_insert_comment
- TinyMCE in comment reply form showing toolbar but can’t edit reply
- Add pending for reply comment in console WordPress