Last active
November 3, 2017 14:32
-
-
Save richardmtl/f6a0277d7f1a139cb6e3d08d4c4e48d0 to your computer and use it in GitHub Desktop.
Adding WordPress.com Follow button to all posts
This file contains hidden or 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
add_filter ('the_content', 'insertWPcomFollowerButton'); | |
function insertWPcomFollowerButton($content) { | |
if(is_single()) { | |
$content.= '<a class="wordpress-follow-button" href="http://exoticmysticism.com" data-blog="http://exoticmysticism.com" data-lang="en">Follow Lisa Joy on WordPress.com</a>'; | |
$content.= '<script type="text/javascript">(function(d){var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');p.type = 'text/javascript';p.async = true;p.src = '//widgets.wp.com/platform.js';f.parentNode.insertBefore(p,f);}(document));</script>'; | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment