Created
December 13, 2014 12:42
-
-
Save thomasgriffin/d9653e3abf9ee80d52ac to your computer and use it in GitHub Desktop.
Change the comment link in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_comments_link', 'tgm_io_change_comment_link', 99 ); | |
/** | |
* Filters the comment link to have the hash match a different | |
* comment system, such as Disqus. | |
* | |
* @since 1.0.0 | |
* | |
* @global object $post The current post object. | |
* @param string $link The default comment link. | |
* @return string Amended comment link. | |
*/ | |
function tgm_io_change_comment_link( $link ) { | |
global $post; | |
$hash = '#disqus_thread'; // This is what you would want to change. | |
return get_permalink( $post->ID ) . $hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment