short code not working in wordpress text editor

admin

Administrator
Staff member
I wanted to add shortcode from the text editor of wordpress post.I have added following short code in the post of wordpress:

Code:
<img alt="" src="[template_url]/images/ic_sol_1a.png" />

Here
Code:
[template_url]
is the shortcode i wanted to use it was not working. when i see it in the post page it render the text not the short code response. Somewhere i saw a solutions like adding following line to functions.php of theme:

Code:
add_filter( 'widget_text', 'shortcode_unautop');

Code:
add_filter( 'widget_text', 'do_shortcode');

But still after adding these lines i am unable to make shortcode work. What could be the possible reason?

my shortcode function is like this:

Code:
function my_template_url() {
  return get_bloginfo('template_url'); 
}
add_shortcode("template_url", "my_template_url");