Quantcast
Channel: WP Woodshed
Viewing all articles
Browse latest Browse all 16

Things to check when your code doesn’t work

$
0
0

If you’ve spent any time in the backend of your wordpress theme, chances are good that you’ve encountered the white screen of death (WSOD) at least once. This is when your site fails to load because you messed something up.

The other day I was working on a website design – writing some custom PHP functions – when I got hit by a WSOD.

I spent almost an hour trying to figure out what I had done, checking other functions that I had written earlier, trying to see any mistakes in my code.

Finally, I spotted the problem. I had used dashes (-) in my function name instead of underscores (_). Oops, forgot that you can’t do that. Lesson learned.

From now on, I’m going to collect any troubleshooting tips here so that when I get hit again with a WSOD or something else, I can refer back to this and hopefully figure out the problem straightaway.

 

HTML
Make sure to check that all ids and classes have opening AND closing quotes.

PHP
Did you accidentally use dashes (-) instead of underscores (_) in your function or variable names?

jQuery
Did you remember to include the closing braces at the end?


Viewing all articles
Browse latest Browse all 16

Trending Articles