I want to get skin URL of my current theme. At present I am working in Magento "rwd" theme.

And I am using below code to get skin URL:


This returns me URL http://localhost/magento/skin/frontend/default/default/

but I need URL like: http://localhost/magento/skin/frontend/rwd/default/

Please help me.

  • the above code works fine for me , check in the backend you assigned correctly – saravanavelu Jul 10 '15 at 9:04
  • Are you calling any file at all? – Adarsh Khatri Jul 10 '15 at 9:07
  • At backend I am setting rwd theme in design.But no effect in this function. – Krupali Mehta Jul 10 '15 at 9:19
  • @AdarshKhatri I am calling this function in php file – Krupali Mehta Jul 10 '15 at 9:20
  • I meant, any css js img file? Could you add your full code how you are calling and where? – Adarsh Khatri Jul 10 '15 at 9:21

I have used following command to get different URL in magento Get Url in phtml files

1. Get Base Url :


2. Get Skin Url :


(a) Unsecure Skin Url :


(b) Secure Skin Url :

$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

3. Get Media Url :


4. Get Js Url :


5. Get Store Url :


6. Get Current Url


Get Url in cms pages or static blocks

1. Get Base Url :

{{store url=""}}

2. Get Skin Url :

{{skin url='images/imagename.jpg'}}

3. Get Media Url :

{{media url='/imagename.jpg'}}

4. Get Store Url :

{{store url='mypage.html'}}

I think this will help you.

| improve this answer | |
  • 1
    Please explain, in which context you call $this->getSkinUrl() - i.e. what is $this?. The rest is a nice list, but irrelevant to OPs question – Fabian Schmengler Jul 10 '15 at 13:15
  • 1
    You can use : Mage::getBaseUrl('skin').'/frontend/default/mytheme/'; – Bhavin Solanki Jul 10 '15 at 18:06
  • 1
    $this is the block in this context. e.g., if you are rendering the current template using following code <block type="core/template" name="my_block" template="page/html/my_template.phtml" />, $this in the phtml file will refer to a block of type Mage_Core_Block_Template – Ejaz Mar 29 '18 at 13:23

You can easily avail the current URL of your existing Magento theme by using the below-mentioned code:

<?php echo $this->getSkinUrl();?>
| improve this answer | |

When you are using

Mage::getDesign()->getSkinUrl($file = null, array $params = array());  

You should pass in the $file parameter for the resource you are trying to retrieve; e.g.:


Magento will automatically search in your site's set theme first and if it's not there it will continue its search using the theme fallback.

| improve this answer | |

This happens when you default theme is default and rwd theme do not have requested image.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.