RECENT POSTS

TWITTER UPDATES

Cleaning WordPress Code For Better performance

Posted by admin On October - 5 - 2009 Comments Off

Since your code is what runs your site behind the scenes, optimizing it can do wonders for your load time. Below are some easy ways you clean up your code to load faster.

* How to Decrease Whitespace in WordPress

Whitespace refers to the spaces used in your code. Some coders, like myself, like to use a lot of whitespace (indented tabs, line breaks, etc.) for better readability and organization. But, decreasing whitespace will speed up your site’s load time by shaving off some extra bytes off the total size.

An example of using some whitespace:

.test {
font-family: Georgia, Times, serif;
font-size: 12px;
color: #000000;
}

An example of minimized whitespace:

.test {font-family: Georgia, serif; font-size: 12px; color: #000000;}
* How to Use external scripts

Instead of placing tons of code in your header.php file, use external scripts. This allows the browser to cache the script so it won’t have to read it for every other page.

An example of using external scripts:

<script type=”text/javascript” src=”example.js”></script>
* Using shorthand CSS In WordPress Blog

Using shorthand CSS is great for everyone. It’s great for you, your browser, and your site visitors. It allows for your CSS to be more concise, and it loads faster too!

An example of using long ass regular CSS:

.test {margin-top: 7px; margin-right: 1px; margin-bottom: 5px; margin-left: 3px;}

An example of using shorthand CSS:

.test {margin: 7px 1px 5px 3px;}

Just $ a day - Advertisement Book Now

Comments are closed.