I’ve worked on many WordPress designs that someone else has build which I had to optimize to get a site loading faster. When I started looking at the WordPress template code I could see these guys did not know what they were doing.
I was in shock, how could you let someone build a WordPress theme and he does not even follow the WordPress Codex. I had a big task ahead of me to fix all the issues.
So you want to know why you suck at WordPress Theme Development?
1: You copy your header code across each template file or you use a PHP include instead of the get_header function. Now this is really bad especially if you are copying the header code over to each template file.
When you should be doing it like this as an example in your functions.php file.
wp_register_script( 'colorpicker', get_bloginfo('template_url').'/zooker-theme-options/js/colorpicker.js'); wp_enqueue_script( 'colorpicker' );
3: You have more than one stylesheet file in your theme. While you could have more than one but when you combine the CSS into one file will surely get some performance boost in the long run as browsers will cache your CSS file. I’ve seen people adding up to 20 style files in the header manually.
You could also use the @import command but you could read some disadvantages of using the css import command here
You should also add your style-sheets to the header in the same why as in number 2, here is some sample code.
$colorLayout = get_bloginfo('template_url') . " /styles/layout.css"; wp_enqueue_style('colorlayout', $colorLayout,'1.0','screen');
5: You don’t use image sprites in your theme when you should be using it where you can. Image sprites can make your site load faster as there are less image files to load and this also means less HTTP requests made by your browser.
Here’s a great article at css-tricks.com where they explain what images sprites are.
6: You are hard coding URL links to images and other files instead of using the get_bloginfo('template_url') code.
Can you think of any other reasons why you suck? Let me know in the comments section below!