Steps
Goes into functions.php if not already there.
Simply call it like this: <?php tempdir(); ?>
Goes into functions.php if not already there.
Simply call it like this: <?php echo get_tempdir(); ?>
if ( ! function_exists( 'tempdir' ) ) {
/**
* Get the template directory URI.
*
* @return string Template directory URI.
*/
function tempdir() {
echo esc_url( get_template_directory_uri() ) . '/';
}
}
if ( ! function_exists( 'get_tempdir' ) ) {
/**
* Get the template directory URI but don't echo it automatically.
*
* @return string Template directory URI.
*/
function get_tempdir() {
return esc_url( get_template_directory_uri() ) . '/';
}
}