Free Blogger Template Ajah |
Setting CSS Code and Javascript Code to Increase Loding Blog Posted: 27 Mar 2010 09:43 AM PDT Many ways to increase loading blog. If in my previous post how to increase loding blog with external link css code, now how to increase loading blog with setting css code and JavaScript code. First, see structure the blog template codes below. Generally, blog template codes as follows like this : <b:skin><![CDATA[/* CSS code ]]></b:skin> <!-- head--> <!-- body--> <!-- html--> Adding new code like Feature Content and auto readmore make the structure of template code changes Example : You want to add Feature Content widget on your blog. Featured Content usually consists of css code and JavaScript code. Placement css code from the tutorial itself refers placed on top ]]></b:skin> and JavaScript code, are usually placed under the code ]]></b:skin> or above code <!-- head--> Featured Content itself is usually only appear on the main post and label post and will not appear on the single post. Structure html code of Feature Content usually like this : <b:if cond='data:blog.pageType != "item"'> <div id='feature-content'> <b:section class='feature' id='feature' preferred='yes'> <b:widget id='HTML30' locked='false' title='Feature Content='HTML'/> </b:section> </div> </b:if> * I use <b:if cond='data:blog.pageType != "item"'> code for Feature Content widget on my blogger template which have Feature Content. Other blog use <b:if cond='data:blog.pageType == "index"'> code for Feature Content. When you click a single post, the Feature Content will be lost but if you look at the View Page Source, CSS and JavaScript code pf Feature Content is still seemingly, and it will remain readable by search engines as the existing code in your blog. Is not this a heavy impact for your blog?? Then how?? You have to do some to "hide" css and JavaScript code from the search engines. 1. css code As i have written above, css code for the Feature Content is usually placed above ]]></b:skin> Move that code under the code ]]></b:skin> with the following structure like this: <style type='text/css'> <b:if cond='data:blog.pageType != "item"'> Your CSS code here </b:if> </style> 2. JavaScript code For JavaScript, make the code like this below : <b:if cond='data:blog.pageType != "item"'> <script src='URL-JAVASCRIPT-CODE' type='text/javascript'/> </b:if> Save. Now, click on one of your blog posts and see the View Page Source. CSS and JavaScript code Feature Content are not appear on your blog and automatically, it will also reduce the weight of your blog that means increase loading your blog. * Note red color * Red color for CSS and JavaScript code it must same with html code of Feature Content Example this trick for Auto readmore <b:if cond='data:blog.pageType != "item"'> JavaScript auto readmore code here </b:if> You can also use this step for other widget blog like code JavaScript for other widget like related post or other. Note: - Code <b:if cond='data:blog.pageType != "item"'> is one of codes to display widget on main blog post and post labels. You can use other codes to set the displaying widget by yourself. - For type and function other code to set widget display, i'll post in next post. |
You are subscribed to email updates from Free Blogger Template Ajah To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Comments
Post a Comment