May 2009

You are browsing the site archives by month.

Simple trick to speed up your WordPress blog

I like WordPress a lot but the fact is that it is slower than serving static HTML pages. However, there is a very simple trick that can significantly speed up the loading of your wordpress blog. The tip is: “Reduce the number of unnecessary PHP calls”

This means replace the PHP calls in your wordpress theme with static HTML for things like blog title, content-type and the like. In the wordpress panel, go to the theme editor and open header.php

For example, change these lines

  1. <html xmlns="" <?php language_attributes(); ?>>
  2. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  3. <title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> &amp;raquo; Blog Archive <?php } ?> <?php wp_title(); ?><?php bloginfo(‘description’); ?></title>

so they look something like this

  1. <html xmlns="" dir="ltr" lang="en-US">
  2. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  3. <title>Web Hosting Blog</title>

Shrink your CSS

I was looking for ways to improve the load time of my website. One of the website optimizations is to reduce the size of CSS files. I came across cleancss. This online tool analyzes your CSS and optimizes it. It also displays the compression ratio after processing. You can either paste your css or just provide a link to the file. The tool lets you choose the amount of compression which is basically a trade-off between readability and size.

How to get the author’s name to link to author’s website in WordPress

There are different types of wordpress themes. Some themes may display the author’s name for the post on the index page of your blog but may not provide a link to the author’s website. There is a very easy fix for that and that is really where the power of wordpress as an amazing blogging platform comes into play.

All you need to do is go to the theme editor in your wordpress blog admin panel. Search for the text

  1. <?php the_author() ?>

in the main index template (index.php file) and replace it with

  1. <?php the_author_link() ?>

It is that simple.