Last active
December 23, 2015 22:49
-
-
Save andrewlaskey/6705645 to your computer and use it in GitHub Desktop.
Wordpress useful common url shortcodes
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 | |
//[imagedir] | |
function image_directory() { | |
return get_stylesheet_directory_uri() . '/images/'; | |
} | |
add_shortcode('imagedir', 'image_directory'); | |
//[homeurl] | |
function home_url_shortcode() { | |
return home_url(); | |
} | |
add_shortcode('homeurl', 'home_url_shortcode'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment