I have made some custom changes to the file wp-includes\comment-template.php
. These changes are periodically lost and I assume it's related to updates for WordPress and the file is modified/re-written.
I have changed:
$comments_link = get_permalink( $post_id ) . '#comments';
To:
$comments_link = get_permalink( $post_id ) . '#disqus_thread';
Is there a way I can persist these changes so they are not lost? Or perhaps there is a better way to make these changes?
Edit
I've tried this code in my themes functions.php
file.
function custom_comments_link($comments_link, $post_id){
return get_permalink($post_id) . '#disqus_thread';
}
add_filter('get_comments_link', 'custom_comments_link', 10, 2);