Created
April 24, 2014 13:43
-
-
Save thagxt/11255110 to your computer and use it in GitHub Desktop.
How to get WordPress Permalinks without the domain
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 | |
/* this goes into your functions.php file: */ | |
function notld_link( $notld ) { | |
$notld = get_permalink(); | |
return str_replace( home_url(), "", $notld ); | |
} | |
// copy/paste code below where you want the url to appear: | |
?> | |
<?php echo notld_link(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment