Dear theme developers,
I was recently working on a Word Press theme I purchased from Theme Forest. At first glance it was nice, but then…..
So here are a few tips on tidiness for all those that LOVE to make Word Press themes and sell them to people like me!
Tip 1 – Is it that !important
Really, is it!? When you are working on a website from scratch, please understand that you have full control. The only reason you will need to use the !important declaration is when you need to override another style.
The problem is that when I need to override a style, you already placed !important on it. So I’m troubleshooting for 20 minutes wondering why the style I added isn’t changing anything only later to say “OOOOOOOoooohhhh, the style has !important on it.” Stop it.
Tip 2 – Use JQuery the right way… and only once.
Well this was a complete test of patience. The client requested a blog post slide show, which of course used JQuery. My issue was when I installed it, it wasn’t working.
“Hmmmmmm,” I said to myself, “Let me look at the plugin code and make sure it’s all correct.” It was. I even downloaded JQuery Cycle again to replace the old file, still nothing worked. Error Console kept saying the function did not exist.
Then there’s that little snippet of code that always gets over looked:
Ah Ha! That’s not supposed to be there!!!
Here’s the thing; when you call JQuery using Word Press you are not supposed to call it like that. What you have to do is the following:
[code language=”PHP”]<?php wp_enqueue_script(‘jquery’); ?>[/code]
This theme was calling it both ways which was causing a conflict with the code that I was trying to add.
Tip 3 – Add body classes and your CSS life will become so much easier.
Word Press has a neat little function where it automatically adds classes to the body where ever you are. It looks something like this:
[code]<?php body_class($class); ?>[/code]
Why is that awesome? Because now the code on the page looks like this:
[code]<body class="home blog logged-in content-sidebar">[/code]
And I can style the page according to the body style. I can add different backgrounds to that page only, I can display a message to those who are logged in. It’s just convenient.
Tip 4 – I’ll decide what goes on the top right!
Theme developers, create a widget area for the top right of the header (that’s why I love Genesis). I mean really, maybe I don’t want to always show a search bar there, or social icons, or any other mundane thing that I didn’t add.
Maybe I’d like to add a phone number, or a neat little graphic. You should allow the user to have control over that area.
Tip 5 – If Statements, use ’em.
Make your footer widgets collapsible. It may not be the easiest thing, but figure it out. It’s annoying when someone adds footer widgets and styles the wrapper with a background color, width and height.
That leaves me with is a giant colored bar across the bottom of the screen that I now have to code out.
I’m sure there are many other tips out there that theme developers can do. But if you are a theme developer and you sell your themes as templates for people to use, don’t make it more work to fix then to actually use.
Oh Yes, and that leads me to the last and final tip.
Always double check your work!