CSS and JavaScript will apply to whatever elements it’s set to apply to. For example, if this is in your external CSS file, it will apply to every div with the class banana:
div.banana {
/* whatever rules you want */
}
$head->addCss('css/styles.css');
$head->addJs('prototype/prototype.js');
There’s no $head variable in WordPress by default. Does $head contain a custom class you made?
This is the header code unchanged:
[code moderated - please use the http://pastebin.com/ and follow the forum guidelines for posting code]
The header works fine, but all the content of wordpress page is centered?
From the code, I’m assuming you’re using the Mage Enabler plugin. This is really an issue with that plugin. I have no idea what the plugin does, but did you check it’s installation and faq pages?
http://wordpress.org/extend/plugins/mage-enabler/installation/
http://wordpress.org/extend/plugins/mage-enabler/faq/
It might help to have a link to your site to see what’s happening.
No I’m not using the enabler plugin.
Although I have used its, code. The CSSjs causes the problem. As it’s loaded, it affects the whole page.
I know, but this isn’t a problem with WordPress. You’re using a class that is added through that plugin’s code. The CSS and the JavaScript added are also specific to that plugin. Without knowing how you installed it, what it does (a link the where you downloaded it would be helpful in this case), or a link to your site to see what it’s doing, it’s nearly impossible to help you. Since it is a problem with the plugin, you can also try asking the author, since he/she will know much more about it.
It’s most likely just a CSS issue. Without a link to the site I can’t say anything more specific.
Can i pu the Cssjs in a loop so that is works only till the magento header? and after that it is not loaded>
There is no CSSjs, it’s a CSS file and a JavaScript file. Once added, they apply to the whole page. If the new CSS file is affecting other parts of your page, there are probably rules within it that are accidentally matching existing elements (tags, ids, classes) of your page. Without seeing the site or both the generated code for your existing site and the added CSS, that’s the only help anyone can offer.