WordPress Theme Editing: 3 Common Pitfalls To Avoid

Written by on July 11, 2011 in Themes, Web Development, WordPress - No comments

WordPress themes are very powerful. Much more than we think. Using only a well coded theme, you can change WordPress to a forum, an eCommerce site and what not.

Talking of power, Spiderman quote comes to my mind:

With Great Power, Comes Great Responsibilities

This quote by Uncle Ben applies everywhere. And the power to edit WordPress Themes is no exceptions. There are some common pitfalls you have to avoid by being responsible.

I have been playing with WordPress themes for about 3 years now and I have encountered these pitfalls often. In this post, I will tell you about these and also how to avoid them.

#1. Using WordPress Theme Editor

Using WordPress Theme Editor is a mistake? This writer is out of his mind!

That’s exactly what you are thinking, right?

See, WordPress Theme Editor is awesome and I love it. Using it for small changes is fine. But when it comes to lengthy changes, it is the last thing you want to use.

It’s not very hard to save at wrong time and then end up with a big PHP error about missing quotes or braces.

How To Avoid: For small changes where you only need to add or remove a thing or two, WordPress Theme Editor is awesome. But when it comes to making big changes, copy the code to a proper text editor like Notepad++(Windows) or gedit(Linux) and then edit. Check after making changes and once you are sure that nothing is wrong, paste in WP and save. It saves you from the headache of replacing files in cPanel.

#2. Looking At Wrong Places

This is something that happens with new developers often.

I remember how I once spent 1 hour fixing the problem of broken formatting in theme files.

The problem was that after one post, all the text was bold + italic. I looked everywhere from PHP to CSS but could not find the problem. Later, I discovered that the problem was placing “Read More” tag at wrong place. I had formatted some text, placed read more tag after that and ended formatting after it. On post, everything was fine and lovely. But homepage? Since there were no ending tags for strong and em, everything went wrong!

Silly mistake, but easy to make.

How To Avoid: If something is wrong, find the exact cause. For example, layout in my case broke after I published that post. When I removed it, everything went back to normal. This made me look for the problem in the post!

#3. Not Understanding Error Messages

Many times, the error messages are self explanatory.

For example, how much time does one need to fix this error in theme:

Error: wp_head() function not found in theme

Not too much, right?

But many times, developers do not pay attention to it and do strange things. ( Confession: I know because I wasted 5 minutes fixing this back in 2008, where actual work was 5 seconds! )

How To Avoid: If you encounter an error, see the line number and if there’s a problem. ( Using Notepad++ in such a scenario helps! ) If that line is fine, see the previous lines because PHP errors are not always accurate. If nothing helps, Google the error!

Related Post: WordPress Debug Bar Plugin. WordPress Debug Bar is a useful plugin for WordPress Developers that helps in identifying debugging problems with WordPress back and front end.

Know of any pitfalls you encounter when editing themes? Do not forget to share in comments. And if this post helped you, please Subscribe For Updates.

About the Author

I love Blogging and I love Coding & Developing. Which one more? I tried to decide and I could not. So, I do both!

Leave a Comment