Created
November 7, 2022 11:50
-
-
Save salcode/346e475fab4e42217c138972788f5cff to your computer and use it in GitHub Desktop.
Add Mastodon "me" link to the header of the homepage on a WordPress website.
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
<?php | |
/** | |
* You'll need to replace | |
* "https://phpc.social/@salcode" | |
* with your own Mastodon URL. | |
* and place this code somewhere executible (e.g. mu-plugins) | |
*/ | |
add_action( 'wp_head', function() { | |
if ( ! is_front_page() ) { | |
return; | |
} | |
echo '<link rel="me" href="https://phpc.social/@salcode" />'; | |
echo "\n"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment