0

Is this possible? For example, I want to change

http://mysitesitesite.com/post-name/comment-page-1/#comment-452

to

http://mysitesitesite.com/post-name/custonname-1/#customname-452

What should I do to get it working? Is there any chance to fix this?

2

In your functions.php add ( there are other rules relating to comment pages you can see them all with Rewrite Rules Inspector plugin, this one just covers the case you mention )

add_rewrite_rule (
  '(.?.+?)/customname-([0-9]{1,})/?$', 
  'index.php?pagename=$matches[1]&cpage=$matches[2]', 
  'top'
);

you'll also need to find in your theme ( possibly in your function.php ) where the comments are generated and change where the id is added to the comment html from something like ( if you can specify what theme your using can be more specific )

<li <?php comment_class('clearfix'); ?> id="comment-<?php comment_ID(); ?>">

to

<li <?php comment_class('clearfix'); ?> id="customname-<?php comment_ID(); ?>">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.