Archives

Download quality Thesis skins
and feel good about your site.

backups

How to Troubleshoot Your Code

by on August 4, 2009 in Thoughts

Day 486 / 365 - Late Night High Level Coding

What sound does a busted website make?

I like to think that when code falls down and breaks its hip it radiates sound waves that are similar to a falling bomb – a haunting techno-ghost whistle that rattles the air as it plumes downwards and zigs through headwinds as it zooms towards the top of your head.

I also think it’s reasonable to believe that when code breaks it’s like an unwitting raspberry pie wrapped in a tin foil shell that’s been placed in the microwave – it’s own elemental properties will work against it and bounce those heat-producing waves right back into the magnetron’s core, causing universal culinary meltdown followed by septic shock and electrical system failure.

I guess what I’m saying is that you better have house insurance.

If you run a website or blog, house insurance comes in the form of a dedicated web developer/site master/internet guru that is well-versed in the art of super glue and duct tape as they pertain to websites.

But these people cost money, and if you just don’t have the budget this year to hire a specialist to surgically revive your code from the operating table, then guess what, it’s up to you to become your own specialist.

Sure, it can be scary to be confronted with all that code staring you in the face like a dog watches the mailman, but if you follow these tips, you’ll be well on your way to fixing your own problems.

How to Troubleshoot Your Code

Start with Syntax

I have lots of clients who fully understand the principle of copy and paste. So they copy code that someone wrote in a tutorial and paste it into their own file. In the perfect world, that would work fine. But in reality, doing so can cause a lot of problem.

Missing syntax is often to blame, so the first thing I do when I either have a problem of my own or get referred to one via a client is dig into the syntax. I start with the obvious: is everything in the correct format i.e. for CSS selector { property: value; }. Other things to look for include missing apostrophes or quotes, broken links and misspelled words (it happen pretty oftne).

For Thesis theme users, I see a lot of new users have trouble understanding how to write functions into their custom_functions.php file , especially since the line: add_action(‘thesis_hook_whatever’, ‘function_name’); is syntax-heavy and most users’ eyes glaze over all those apostrophes.

Now that your syntax is solid, what if your site still doesn’t show up as you’d like?

Follow Your Own Path

Take a look at your image sources and make sure that they’re all working. You should be able to copy the image source into your browser and see an full size view of your image. If that doesn’t happen, then you’ll need to correct the path.

What’s Next?

With the basics covered, if your site is still not showing up properly then it could involve a myriad of issues. You could try to toss a few emails back and forth with website fixers, but that can be and often is very time consuming. The time you’ll waste trying to determine the problem could take up to a week, and in the mean time all of your customers will be faced with an off-looking site. Yikes. If that’s not a scary thought to a web-based business then I don’t know what is. Your best bet is to…

Get Help

If you’ve gone through your syntax and carefully covered your code, you’ve probably spend a big chunk of time working on code that you could have spent more productively growing your business. There comes a point when you have to decide if it’s better to keep working on it yourself or call in a professional. When time is an issue, hire a professional who can jump in and get the job done. Sure, it will cost a bit, but you will be able to free up your time to work on your specialty – growing your business, and that is priceless.

Read More