Updates & Subcribe : premium wordpress theme for profesional wordpress blog profesional design wordpress theme for profesional wordpress blog premium wordpress theme with profesional design layout blog premium wordpress template premium wordpress theme
Lifetime Support & Updates. 70+ WordPress Themes. Buy 1 and Get 2 FREE or Buy 1 Get 3 FREE WordPress Themes Advertise Space for Text Ad. Max. 120 characters only $15/2 Months Great price & full support. Unlimited access 40+ elegan & profesional WordPress Themes only $0.79/Theme
25/03/2010

Setting CSS Code and Javascript Code to Increase Loading Blog

Advertisement
css and javascript code to increase loading blog
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 != &quot;item&quot;'>
<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 != &quot;item&quot;'> code for Feature Content widget on my blogger template which have Feature Content. Other blog use <b:if cond='data:blog.pageType == &quot;index&quot;'> 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 != &quot;item&quot;'>

Your CSS code here

</b:if>
</style>


2. JavaScript code

For JavaScript, make the code like this below :
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<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 != &quot;item&quot;'>

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 != &quot;item&quot;'> 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.
Advertisement
WordPress Theme to Blog is a gallery of premium Wordpress themes with profesional design to help you find a wordpress theme to make your WordPress blog look great

Updates via E-Mail

Labels:

2 comments:

NyamOOK said...

nice inpo gan...

http://nyamook.blogspot.com/

Forex Market said...

The post is so informative on the worthwhile topic

Post a Comment