The Secret to Debugging Code: Blog Template / Theme Problems

By BLOGBloke April 22nd, 2008 | 66 Comments Buzz thisBuzz it Share this on Facebook

The Secret to Debugging Code: Blog Template / Theme Problems

For the past couple of weeks I’ve been taking advantage of my hiatus from blogging to concentrate on finishing minor tweaks that were necessary to my template / theme.

You might not have noticed, and although these changes may seem relatively minor they are in fact fundamentally important to the design. They were also more difficult to accomplish so I had not bothered to implement them until now.

For example, I moved the MyBlogLog widget over to the sidebar where it belonged. That was the easy part.

I wanted to replace the block by showcasing more of my recent posts with one easy glance on the main page just below the video. The hard part was how to accomplish it and not duplicate the same posts that are shown in the left column. I eventually accomplished it with the help of a plugin.

Funny thing was the next day I noticed some unusual things happening on the post pages. The post was being truncated at the end of the sidebar! Hmm, and to make matters worse it was only happening in IE!

I hadn’t noticed the problem the day before because I made the changes late at night. I like to do template changes at night because that’s when there is less activity on the blog. I was tired at the time and wanted to get to bed so I hadn’t bothered to test it properly. Big mistake!

So the next day I disabled the plugin thinking that would solve the problem, but it was still acting up. Stink!

Because I didn’t notice this until the next day I had temporarily forgotten that I had also moved my statistics tracking code from my header to the bottom of the sidebar. Must be that alzheimer’s thing again. ;-) So could that be it?

I removed the code and it was working fine again! After experimenting around a little I eventually decided to put the code into my footer imemdiately before the </body> tag. My rationale was is if it truncated the post there it wouldn’t really matter because that was the end of the page anyhow.

So guess what? You guessed it, all is working well again!

Baby Steps:

The most important thing that I want to get across in this post is that you should NOT make too many changes at one time. Make just one change and then take your time testing it. Give it at day or so to play around with it before you decide to make any more changes.

Click on all of the links and notice if anything looks strange or out of place. Check it out on the main page as well as the post pages. Scroll all the way down and back up again carefully scrutinizing everything.

Test it in the major browsers like Internet Explorer, Firefox, Opera and Safari. If all looks good, then you can save a backup onto your desktop and make more changes if you want.

But if there is a problem, backtrack over what you recently did. Or in other words take a step backwards by reverting your template back to what it was before you made the last change that screwed up.

Maybe that would entail disabling that last plugin you installed. Or perhaps it’s your code that you messed up. Disabling a plugin is easy, but if it’s your code then it’s probably just a minor syntax error.

For example, perhaps you made some changes to your CSS code. You were trying to indent a paragraph and all hell broke loose. Then just Google and chances are you will find the fix you need.

But if worst comes to worst and you still can’t figure out what went wrong, restore that last backup you made from your desktop. Test it again. If it looks normal then you know it was that last change you made.

BUT the important message here is you should NOT make too many changes at one time. Why? Because it will be harder for you to backtrack and remember what you did that caused the problem in the first place.

Baby steps baby…

UPDATE: Then again sometimes all hell can break loose. After further investigation it’s become clear that I am suffering database issues that are not repairable. I’ve contacted my blog host provider and they will be transferring this blog to a fresh install of Wordpress. So things may be acting even more strangely today. Stay tuned…

Filed under: Blog Design Tips, Blog Tips, Bloke's Bloopers blogging tips, Wordpress, wordpress plugins

What Next? Read More Tips From BLOGBloke:

Sharing is Caring...

 
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • TwitThis
  • Facebook
  • GoogleBuzz
  • Digg
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Live
  • YahooMyWeb
  • Sphinn
  • LinkedIn
  • Reddit
  • email
  • Keep in touch with BLOGBloke and don't miss another blog tip:

    Subscribe here to the Better Tips Newsfeed!   

    Follow @BLOGBloke on Twitter for Social Media Tips & News!

            Opinions? (click here to jump to the comments form)

    Ok Blokesters it's your turn to tell me what you think, ask a question or suggest a blog tip. Don't forget the comments policy and I'm looking forward to reading what you have to say.

    66 Comments so far to “The Secret to Debugging Code: Blog Template / Theme Problems”

    1. Everything looks and works awesome, even sideways (neck cramp, head on pillow)!

      I don’t know how you keep up with having a pre-made template. The control freak inside me makes me build templates from scratch.
      (My templates unfortunately are not coded for distribution but I hope to make one just for that purpose in the future)

      Over the past few months I’m quite proud of how much I learned and now making new WordPress templates don’t look that hard.

      I use Dreamweaver to manage my code and files and I don’t think I’ll ever want to use another program !

      Jaffer’s last blog post..April Showers for Blogging

      [ Reply..]

    2. Hi Jaffer. It’s good to hear from you again.

      The reason why I started with a “pre-made” template is because I wanted a news magazine style. The bottom line is it would have been too much work starting from scratch and taken away my time from actual blogging. But I have made so many changes to the original code that I feel that it is my own theme now. In fact my blog doesn’t look much like the original at all.

      I like to use WeBuilder for coding. It handles everything including html, css, javascripts and php. A very powerful piece of software and inexpensive as well.

      Which version of Dreamweaver are you using?

      [ Reply..]

    3. I started with MX a few years ago and then upgraded to Dreamweaver 8 and I’m still using it.
      (I had to read a few books before things began to make sense)

      Jaffer’s last blog post..April Showers for Blogging

      [ Reply..]

    4. Yes, Dreamweaver can be daunting which is why I recommend using WeBuilder. It’s easy and does so much more than just HTML. You should take a look at it.

      I also used MX. My daughter bought a copy from Asia a few years ago. It only cost her $5. It was probably a bootleg because the serial didn’t work ;-)

      [ Reply..]

    5. Like the new layout. Much nicer on my eyes… and very inviting to boot. Well done.

      [ Reply..]

    6. Wow, I don’t even recognize your place anymore.

      Tica Macha (Teri)’s last blog post..It’s BACK!!!

      [ Reply..]

    7. It’s revered back to the default Kubrick theme !

      What happened to your template bloke ? Lost it ?

      [ Reply..]

    8. Hah! Is this still April Fools by any chance? Someone pulled a joke on me that’s for sure.

      I contacted my blog host last night to investigate database issues and I woke up today to a different template. Someone must have hit the wrong button.

      My heart is still beating … pant, pant, pant. All is well now, at least I think.

      [ Reply..]

    9. I like your theme bloke. You have done great things to make it better than a off the self theme.

      Curtis’s last blog post..How Have I Become Both a Skydiver And Garden Lover

      [ Reply..]

    10. Thanks Curtis, which proves you can only please some of the people some of the time ;-)

      [ Reply..]

    11. I installed a copy of wordpress on my local drive and I tried to test all the changes locally before uploading to the host. Sometimes some error don’t appear in local drive, only on internet, but, most of the time, it is okay.

      It is a bit tedious, but, I think that will help to minimize most of the possible problem.

      Asia’h Epperson’s last blog post..You Comment I Follow. Err… Actually I don’t

      [ Reply..]

    12. Or you could install another copy of your theme on a subdomain with your blog host and play with it there.

      [ Reply..]

    13. Tons and tons and tons and tons and tons of sympathy. When I make changes to my own blog, it will look peachy in Firefox but scream AGONY! in IE until I figure out what kind of custom hack will fix that problem.

      Just spent 2 hours this morning overhauling the site and let me tell you, “pain” is a complimentary word for the debugging.

      Did get it right that your site also defaulted for no apparent reason? That happened with one of my sites as well; I fixed that by copying my current theme into the Default directory.

      Data poinst,

      Barbara

      Barbara Ling’s last blog post..Insane Luxury Music - Party hard with this 5K Jukebox

      [ Reply..]

      Indeed, misery loves company ;-)

      [ Reply..]

      Blog Bloke (@blogbloketips) reply on May 4th, 2008 1:13 pm:

    14. I forgot to include - if one REALLY want to experience soul-searing agony, one can check out how one’s site looks in http://www.anybrowser.com/siteviewer.html .

      Truly something that reduces fingernails.

      Enjoy,

      Barbara

      [ Reply..]

      I’ve used that myself.

      [ Reply..]

      Blog Bloke (@blogbloketips) reply on May 4th, 2008 1:22 pm:

    15. I am glad to have found your blog, there is a lot of useful info.

      [ Reply..]

    16. awesome site brotha http://bit.ly/1jshln

    17. @Gaia Herbs, some look like downtown Las Vegas in the evening. http://bit.ly/2ub7iQ

    18. @Gaia Herbs, some look like downtown Las Vegas in the evening. http://bit.ly/2ub7iQ

    19. @CFI, @hospitalera … my head was spinning when I wrote it ;-) http://bit.ly/1CQix9

    20. RT @BLOGBloke: 10 Reasons Why I Don’t Like Your Blog http://bit.ly/2TRLSx

    21. 10 Reasons Why I Don’t Like Your Blog http://bit.ly/2TRLSx

    22. @Humayon, if you are just a blogspot user then you don't need to bother with dns settings. But I still recommend ge… http://bit.ly/1fDYre

    23. @hari saryono, I wrote an article about why we should not play into terrorists hands by linking to these horrific v… http://bit.ly/2aTKBw

    24. @InternetMarketingMentor, here's another analogy for you. Your blog is your permanent home and social networks are … http://bit.ly/4hZtE

    25. Optimize Your Blog - Making Your Blog Search Engine Friendly http://bit.ly/4A9Go5

    26. @Mike, glad you liked it. If you're serious about blogging then Wordpress is the way to go. http://bit.ly/33GQUp

    27. via @BLOGBloke: Hi There! Thanks for following. Why not ask me a question or for more blog tips visit http://tinyurl.com/5zjajb. Cheers!

    28. @Michelle, you do not need a subdomain for it to work. A subdomain is also a bad idea for SEO. You need to go over … http://bit.ly/5Z3vbE

    29. @Justin Gill .. thanks for saying so Justin. It always feels great to hear from another happy customer. :-)

      Cheers! http://bit.ly/5Z3vbE

    30. blog hating at http://www.blogbloke.com/10-reasons-why-i-dont-like-your-blog was just pinged to 91 Services!

    31. @Kay, I never thought of it that way http://bit.ly/1CQix9

    32. @humglum http://www.blogbloke.com/moving-wordpress-blogger/ basically… no. doesnt look like it'll happen.

    33. @BLOGBloke,

      I decided to get rid of the Blogger redirect as the redirect via modification to .htaccess works, t… http://bit.ly/5Z3vbE

    34. @Michelle, redirect speeds will depend on the blog host's servers and your internet connection. You only need to pa… http://bit.ly/5Z3vbE

    35. @drugi, you mean "you can please some of the people all of the time and all of the people some of the time, but you… http://bit.ly/4CvJh7

    36. Finding Your Blog Voice http://bit.ly/5LD5kQ

    37. @zarazek, don't get your domains through Wordpress. Use GoDaddy or something similar. http://bit.ly/1fDYre

    38. Saw an advertisement for Moving Blogger to Wordpress Service. Why not save your money and read my free guide? http://bit.ly/6rFYFE They do

    39. hmm.. informative )) http://bit.ly/6krJX6

    40. I should notify my girlfriend about your post. http://bit.ly/6iqFfC

    41. hello everybody, how are you all doing.i am liking this web sight i might start staying on it more. me i stay sick … http://bit.ly/6krJX6

    42. @Cdathy Tibbles, I host images on my wordpress.com account. Let me know it goes. I always like to hear from happy c… http://bit.ly/5Z3vbE

    43. @BLOGBloke, Yeh, I had a domain from a different comapny but Wordpress said I still had pay them to be able to link… http://bit.ly/1fDYre

    44. @zarazek, so if I understand you correctly your blog was being hosted by Wordpress and then they insisted on chargi… http://bit.ly/1fDYre

    45. I'm very happy with the refinements I made to the blog. What do you think? http://www.blogbloke.com/

    46. How to Produce Your Own Podcast http://ff.im/-dm32o

    47. "10 Reasons Why Twitter Is So Popular" ( http://bit.ly/8CM5gX )

    48. Updated my Blokester Buttons for 2010. Grab yours now .. http://www.blogbloke.com/introducing-new-blokester-buttons/

    49. How to Make Professional Podcast Videos for Your Blog (Vlog) http://bit.ly/7EHvN8

    50. RT @projournalist: How to Make Professional Podcast Videos for Your Blog (Vlog) http://bit.ly/7EHvN8

    51. RT @journtoolbox RT @projournalist: How to Make Professional Podcast Videos for Your Blog (Vlog) http://bit.ly/7EHvN8

    52. @BLOGBloke - really ok - am trying to pull off this from your blog http://bit.ly/5Zv5kW (thank you so much for documenting this - it rocks)

    53. @BLOGBloke - do you think I could use this service to redirect or park my domain like you mentioned in http://bit.ly/5Zv5kW

    54. Great tutorial on migrating your blog from #blogger to #wordpress. http://bit.ly/Nlr2k

    55. @FijiLomalagi my email is at the bottom of my blog http://www.blogbloke.com/

    56. @Kwame, you will have to play around with the Apache code .. http://bit.ly/5Z3vbE

    57. @Ankit_A see if this helps.. http://bit.ly/Nlr2k

    58. @drewmillikin My technical skills are limited, but I found this post to be very helpful: http://bit.ly/7LY764. My advice: pull the trigger.

    59. @Adam Johnson .. it was my pleasure and glad it worked for you .. http://bit.ly/5Z3vbE

    60. @gopmommy Your domain name redirection is done on your hosting service. Check this tutorial http://is.gd/8TXkI

    61. @stepfanieb Check #6. http://bit.ly/Nlr2k

    62. RT @BLOGBlokeTips How to Make Professional Podcast Videos for Your Blog (Vlog) http://bit.ly/2JgxLd

    BLOGBloke AvatarAdd A Comment .. your avatar (like mine on the right) will magically appear from your social profiles like Twitter or Gravatar. You can also add a comment to your Twitter or Facebook pages by clicking on the following so-very cool buttons  Share

    Tweet This? Click Here 

    Subscribe to Better Blog Tips and the New Media Newsfeed Subscribe to comments for this post by RSS | TrackBack URL

    You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

    Subscribe to Better Blog Tips and the New Media Newsfeed Thanks for dropping by and don't forget to Subscribe to the Better TIPS Newsfeed