So we have a site and when i view source there is a Link Rel="stylesheet" line entry which fetches a stylesheet. When i click this link in view source it leads to empty page as in not found, so i want to remove this Link Rel entry from my head section.
I have checked the head.phtml for the theme and couldnt find the entry. I have also checked the local.xml file and there is no such entry. I have also checked the head.phtml for the base/default/ dir and no love.
How can i remove this link from my head section when the file it is trying to call and the directory it thinks it is in does not actually exist at all.
-
Please check if your CSS is merged or not from: System -> Configuration -> Advanced -> Developer -> CSS settingsAman Agarwal– Aman Agarwal2018年03月20日 01:57:14 +00:00Commented Mar 20, 2018 at 1:57
-
It is not mergedMatt Godwin– Matt Godwin2018年03月20日 13:15:02 +00:00Commented Mar 20, 2018 at 13:15
-
Can you share the css filename and the URL of your website?Mohit Kumar Arora– Mohit Kumar Arora2018年03月21日 04:53:09 +00:00Commented Mar 21, 2018 at 4:53
2 Answers 2
Magento searches for a CSS/JS/image resource in the following manner:
- Current theme directory
- Default directory (if exists) of the current theme package
- Default directory under base theme package
If Magento does not find the resource in any of above paths, then the resource is considered 404 not found.
Although this is not Magento's way of finding the appropriate file, from where the CSS file is being called, I hope it will help you find the file faster.
- Open a file editor like sublime text, notepad++ or any other of your choice.
- Do a search for the CSS file name within folders. Below are the shortcuts to search within a folder for some of the popular editors:
Sublime Text:
Press CTRL + SHIFT + F.
Notepad++:
Press CTRL + SHIFT + F.
Geany:
Press CTRL + SHIFT + F.
For other editors, you can check their respective documentation.
- After searching for the file where your desired CSS file has been called, you can easily comment/remove the line to avoid inclusion of the file.
Please have a look on page.xml of your theme:
default\layout\page.xml
you can see under
<block type="page/html_head" name="head" as="head">
Something like this:
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>