The Secret to Modifying, Debugging Your Blog and other Technical Issues
I get a lot of questions about how I did this and that, especially when it comes to template tweaking and other technical things. So I thought I would let you all in on a little secret. When you are trying something new, don’t reinvent the wheel.
I started my computing career as a programmer back in the days when there was no such thing as a desktop, and computers filled up entire rooms (i.e. mainframes). Believe me when I say that I was not a naturally gifted programmer and I found it very difficult at first, until I learned the secret.
Programming is much like writing. Everyone has been influenced by someone else one way or another, and you start with writing the easy stuff and working your way up. (The blogosphere is no exception, or should I say the worst offender where so many bloggers are reiterating what someone else has already said. But I digress.)
The point that I’m trying to make is in the case of Wordpress there are literally thousands of theme/templates available for you to choose from. So my advice is — do NOT try to create your own theme from scratch. Find a theme that you can work with and has features that you are looking for, and then modify it.
Learn to Step Backwards
If you don’t know how to change something or how it works, then deconstruct the template. OR in other words, reverse-engineer it. Use that handy ctrl-f (find command) in your browser and search for the code you are looking for. See how they did it. Chances are you will be able to figure out how to modify it according to your own needs.
Baby Steps, Baby
If you should get into trouble – backtrack. What I mean by that is take things a step at-a-time. Try something, then test it. Try something else, then test it again. Little baby steps, and save your changes that worked onto your desktop as a file.
If it works then move on to the next step, but don’t make big sweeping changes all at once. So if you should find yourself in trouble (and you will) then it’s simply a matter of reversing that last change you made (i.e. pasting back that last copy you saved). That way you won’t lose all of the progress you’ve made so far.
The same goes for your plugins. Just today I was able to fix my “Top Commenters” plugin. The reason it wasn’t working properly was because it was trying to make an ordered list. Well, for some reason that wasn’t compatible with my template, so I just removed the < li > tag from the code and oilla. It works now! I also think it looks better this way and takes up less space in my sidebar. Bonus!
It’s really that easy! That’s how I do it and I’m by no means a programming guru. There are much more gifted coders out there than me.
Here’s another example. Just recently a reader asked me how to modify the part of the comments section where it invites your readers to leave a comment. In my case it says “Leave a Reply“. Logically, that part of the code should reside in the theme comments file. A simple search for “Leave a Reply” came up with this:
if (’open’ == $post->comment_status) : ?>
<h3 id=”respond”>Leave a Reply</h3>
So all you have to do is change the “Leave a Reply” part. Easy peasy!
Don’t Rely Too Much on Plugins
One of the benefits of using Wordpress is there are tons of plugins that can do the work for you. BUT heed this warning — if you add too many plugins it can slow down your blog, especially the ones that filter your database.
So it is to your benefit to become familiar with your theme/template and learn how to hard-code your modifications rather than just relying on plugins to do it for you. The more familiar you become with your code the easier it will be to change it. The more you can change it, the more power you will have over your blogging destiny.
After all, isn’t that the reason why you chose Wordpress in the first place? So don’t be afraid to learn and stretch yourself. As long as you make regular backups of your code you can always revert it back again.
In my case the transition to Wordpress is almost complete. There’s always little tweaks here and there that pop-up, but all in all it’s about 90% done. Of course, I still have to point my internal links back to this blog, but I think I have a fix for that and I will make an attempt at it sometime this week.
Ok, now here is your chance to request a post. Just tell me what you would like me to write about, and if I should decide to take your challenge I will give you an honourable mention with a link to your blog.
You can’t beat that. You win two ways — you get your answer and a link to boot. Cool.
I’m waiting … tick, tock…
What Next? Here's more from BLOGBloke:
Filed under: Blog TipsTweet
What Next? Here's more from BLOGBloke: