Skip to content

Instantly share code, notes, and snippets.

@andrewlaskey
Last active December 23, 2015 22:49
Show Gist options
  • Save andrewlaskey/6705645 to your computer and use it in GitHub Desktop.
Save andrewlaskey/6705645 to your computer and use it in GitHub Desktop.
Wordpress useful common url shortcodes
<?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