How to get the path to theme in Views for linking an Image When creating a view, I rewrote the output in "Rewrite Results". There I have an HTML with a link to an icon in the theme folder.

&lt;ul class="stats vertical"&gt;
       &lt;li&gt;&lt;a href="#"&gt;&lt;img src="sites/all/themes/my_theme/images/my_icon.png"&gt;[field_output]&lt;/a&gt;&lt;/li&gt;
       &lt;li&gt;&lt;a href="#"&gt;&lt;img src="sites/all/themes/my_theme/images/my_icon.png_orange.png"&gt;[field_text_output]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


As you can see that I am hard-coding the path to my icons. This works if this View Page is accessed from home page. But when this View page is accessed from some 2nd or 3rd level page, the icons are not shown.

Is there any way I can get a relative path to my theme within Views?

Thanks.
I will encourage you to rethink your hardcoding approach and instead implement your icons as CSS background images, using views to apply the desired classes to your field elements. This approach will allow you to avoid the options I am about to suggest :)

Option 1: Copy one of the following files found in the views module theme folder into your theme's templates folder: views-view-field.tpl.php, views-view-fields.tpl.php and rename it according to your needs using the Views template files documentation - and in your case you may want to look at views-view-list.tpl.php. Then code your img tag into this field template logic, constructing your img src with PHP using the $base_url variable. Clear the cache. 

Option 2: Install Views PHP and add a Global:PHP field and construct your img src with PHP using the $base_url variable.