Today itâ€™s time for another edition of the â€œWordPress Advice of the Monthâ€ monthly series, which isnâ€™t really monthly, by the way. (Hereâ€™s the previous episode, in case you missed it: Why Free Themes are EVIL)
For those of you who donâ€™t know, WordPress hacks are various things you can implement that change the standard way of how WordPress works. It usually involves some PHP, HTML, or CSS coding.
The positive thing is that WordPress is very hack-friendly by nature. Thatâ€™s basically what functions.php files, and various other structures and programming nuances are for. And the most obvious indicator of them all â€“ the sole existence of these things called plugins.
All of this confirms that WordPress encourages everybody to play around and change the way a standard installation operates, so it can better fit each individual webmasterâ€™s needs. This is one of many reasons why WordPress is THE leader in todayâ€™s world of blogging software.
Over the years hundreds of hacks have been invented. PHP hacks, HTML hacks, CSS hacks, JS hacks, security hacks, usability hacks, the list goes on. And many of them are really really cool and highly popular. As a matter of fact the blog youâ€™re reading right now uses at least 10 hacks (I canâ€™t remember exactly).
Without further talk letâ€™s just take a look at the piece that has reminded me of the importance of WordPress hacks. This has been recently published by the guys at Onextrapixel:
The headline is pretty self-explanatory. Itâ€™s a compilation of some of the coolest WordPress hacks. Ones that make the list are:
- How to Display Adsense to Search Engine Visitors Only
- How to Display Dates as “Time Ago”
- Display an Incrementing Number on Each Post
- Style Comments Based on User Roles
- How to Add a Login Form Anywhere In Your Theme
- How to Show Related Posts Without a Plugin
- How to Style Posts Individually
- How To Add Bio Info To Your WordPress Blog Posts
- Creating Automatic Short URLs with Bit.ly
- Create an Ajax-based Auto-completing Search Field
So hereâ€™s the big question:
Do you really need hacks?
Here’s something for a WordPress advice… I truly hate giving this answer, but â€“ it depends. You have to decide for yourself. Thereâ€™s really no one-size-fits-all type of a solution. Hereâ€™s what I mean:
Letâ€™s take a look at this one: how to display dates as â€œtime agoâ€.
Itâ€™s not particularly more readable than the standard way of displaying dates. So why would you want to do this? Well, some people consider it simply cooler. Other reason could be that this way of displaying dates becomes a trend on the internet. Sites like Twitter, Digg, and many others are using it. The only difference is that your blog is not updated every 2 seconds. Probably something more like every 2 days. That means that thereâ€™s not going to be a lot of situations when a visitor actually sees a message like â€œpublished 6 seconds agoâ€.
(By the way, in my opinion displaying dates is something you donâ€™t really need to be doing at all for each individual post. Whatâ€™s the point of notifying the reader that what theyâ€™re about to read is probably outdated?)
So do you need those hacks? In a word, no. Butâ€¦ do you want to have them? Well, thatâ€™s a totally different story, and itâ€™s up to you to decide. Some people will try to convince you that some of the hacks are absolutely crucial to have, which isnâ€™t true. Hereâ€™s the thing, the only things that are crucial to have have already been implemented as parts of the standard WordPress package, or are provided by the most popular plugins. Hacks are only a sort of icing on the cake.
How to use WordPress hacks
The most popular way of creating and using a hack is to edit the functions.php file of your current theme. You can do it right from your admin panel or by downloading the file via FTP and editing it in your favorite source code editor.
Source code is a big and scary-sounding phrase if youâ€™re not a programmer, but donâ€™t worry. In most cases you donâ€™t have to know anything about programming in order to activate a hack. The instructions that go along with each hack are usually very detailed, so everyone can easily activate them. However, you do have to make sure to follow these instructions exactly, word for word. Otherwise, things can get bad. Which brings me to my next pointâ€¦
Itâ€™s a good idea to make a backup copy of your functions.php file (or any other file you intend to modify) before you start playing with it. Then you can always go back to the previous version in case something goes wrong.
Other equally cool WordPress hacks
Thereâ€™ve been hundreds of posts written on this topic, hereâ€™s a handful that my delicious.com profile tells me to share with you:
- 10 Techniques for Customizing the WordPress Admin Panel
- Separating Trackbacks from Comments
- 25+ Extremely Useful Tricks for the WordPress Functions File
- 10 Useful WordPress Security Tweaks
- Top WordPress hacks of 2009
- 10 Useful WordPress Coding Techniques
- 10 Handy WordPress Comments Hacks
- 15 Killer Hacks for WordPress that Are Extremely Useful
- 10 useful WordPress theme hacks
- A to Z of WordPress .htaccess Hacks
I have a task for you. Check out some of the sites above (and the aforementioned post by Onextrapixel), choose your 5 favorite hacks and tell me which ones they are. Iâ€™m really curious about this.
One more thing. Here’s how to add “nofollow” to non-homepage blogroll links. In WordPress, of course.