How to add Custom javascript and css file in magento

Answer

It's much important for Magento theme developer to add their own external js and css file
so that they can use custom JavaScript and css and it much easier in Magento to add this. as just you need
to add local.xml in your own theme and add below structure code in that file
in local.xml under layout folder of your own theme /or default theme that currently in use
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<default>
<reference name="head">
<action method="addCss">
<stylesheet>css/pcds_style.css</stylesheet>
</action>
<action method="addJs">
<script>pcds/jquery.js</script>
</action>
</reference>
</default>
</layout>

here you can replace name of js and css file accordingly yours and folder name too just keep in mind

your css file would be add in below path
/skin/frontend/default/pcds/css/

and  js file directly
js/pcds/

folder here PCDS is our own theme name or folder name of default or current theme 

All magento Questions

Ask your interview questions on magento

Write Your comment or Questions if you want the answers on magento from magento Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---