Friday 3 October 2014

How to block CSS and js file loading in Google Blogger template?

First make a backup of your template. Make sure you have your new css code created and ready for input.
TO BLOCK REMOVE CSS:
Find and delete this:
<b:skin><![CDATA[lots-of-css-code]]></b:skin>
Replace it with this:
&lt;!--<b:skin><![CDATA[]]></b:skin>
Find and delete this code and everything in between. The entire thing is unnecessary now:
 <b:template-skin>bunch of code</b:template-skin>
Add your stylesheet link BEFORE the <b:skin> code:
<link href='https://www.somewhere.com/style.css' rel='stylesheet' type='text/css'/>&lt;!--<b:skin><![CDATA[]]></b:skin>
Add any other css code AFTER the </b:skin> code:
&lt;!--<b:skin><![CDATA[]]></b:skin><style>.googlecode{display:none}</style>
TO BLOCK REMOVE JAVASCRIPT:
Find your closing </head> tag and replace with this:
&lt;!--</head>--&gt;&lt;/head&gt;
Find and delete this code:
<b:include data='blog' name='all-head-content'/>
Replace it with this:
<meta content='blogger' name='generator'/><link expr:href='data:blog.url' rel='icon' type='image/x-icon'/><link expr:href='data:blog.url' rel='canonical'/><data:blog.feedLinks/><b:if cond='data:blog.url == data:blog.homepageUrl'><link href='http://www.blogger.com/openid-server.g' rel='openid.server'/><link expr:href='data:blog.url' rel='openid.delegate'/></b:if>
Enjoy your improved pagespeed.

source : http://stackoverflow.com/questions/13964673/how-to-block-css-and-js-file-loading-in-google-blogger-template

No comments:

Post a Comment