まず、ウィジェット内でもショートコードが使えるようにfunctions.phpに下記を書く
[html]add_filter(‘widget_text’, ‘do_shortcode’);[/html]
そしてショートコードを登録する
[html]
function shortcode_templateurl() {
return get_bloginfo(‘template_url’);
}
add_shortcode(‘template_url’, ‘shortcode_templateurl’);
[/html]
すると、ウィジェット内に[template_url]と書いたらパスが表示されるようになる。