Epic Faerie fantasy novels by writer James T Kelly

Three Great WordPress Tweaks

The more observant of you may have noticed that things looked a little odd over the weekend. You may even have noticed that there’s no more annoying grey line in my header image. Or that my sidebar doesn’t disappear on a mobile device. Or that my Twitter widget doesn’t show replies (when it works). I hope you have because they had me scratching my head for ages! But those problems are solved at last and, to save anyone else’s scalp from unnecessary friction, I thought I’d share the secrets.

First you need a child theme

If you make changes to the coding of your theme, chances are strong that those changes could be wiped by an update. A child theme is a mini theme that takes all the looks from the main theme but allows you to fiddle to your hearts content. But don’t be lazy. I used the One-Click Child Theme plugin because it was quick and easy. I paid for that when WordPress decided to punish me for my laziness and eat it for lunch. Do it properly.

Got a grey line above your header image?

I thought I’d messed up my image dimensions but this is actually down to a little line of code in the style.css file. Open it and find the line that reads margin: 2em auto. Change that to margin: -.2em auto and kiss that grey line goodbye!

Twenty Eleven display problems on a mobile device?

The Twenty Eleven theme adapts itself to the width of the screen and will dump your sidebar(s) underneath your pages if it detects a small screen. You can stop this misbehaving by going into the header.php file and deleting the line including the text:

meta name=”viewport” content=”width=device-width”

This will mean your website will display on a mobile device just as it does on a computer.

Want to hide replies on the Twitter widget?

Nothing to do with WordPress or themes but this one drove me a little mad! I don’t like to sees replies in a Twitter widget; it’s like listening in on a conversation and it doesn’t tell you if the tweeter is worth following. But hiding replies isn’t an option in the Twitter widget, so you need to get clever.

When creating the widget on the Twitter site, you’ll need to copy some code and paste it into a text widget. Simply edit this text by inserting &exclude_replies=true after your Twitter username. (Using mine as an example, it should look like this:

}).render().setUser(‘realjtk&exclude_replies=true’).start();

And there you have it! I hope sharing that was helpful and, if any of it didn’t make sense, feel free to ask questions.