10 WordPress Hacks to Make your Life even Easier

The last post that I had made on 10 WordPress Hacks to Make your Life Easy got a good number of comments and views. Based on the success, I have decided to make another WordPress Hacks post to make your life EVEN easier. Here is the list of 10 new hacks ready to be bookmarked :-
How to make a Sticky Post

A sticky post is one that will always be on top of all your recent posts and stay there until you change it. You can use a sticky post as a notification, reminder or something that you want to emphasize to your readers. Here is how you can make a sticky post :-
First, decide on a category name that will hold all your sticky posts. For example, you can create a new category and name it “Stickies” and later use this name to call the posts from this category. Now, if you have ever opened the index.php file in any blog styled WordPress theme (Just install the basic Whiteboard theme for this tutorial), you will notice that it has a loop which is used to call your posts.
The loop begins here :-
and this loop should end here :-
Sorry, nothing matches that criteria.
Copy everything from the start to the end of this loop (including the above code). Paste it above the existing loop so that index.php will have two identical loops, one over the another. To make the sticky post appear, we will use this new loop which will call a single post from the “Stickies” category.
In the top loop, just replace this code :-
with this :-
have_posts()) : $my_query1->the_post(); ?>
So, if you decide to change the category name from “Stickies” to something else, just change it in the above code. You can also change the number of posts that you want to show from the sticky category by modifying the showposts variable.
Breaking Categories into Columns

Normally when the list of categories is displayed in the sidebar or on any part of the theme, it displays in a single column. Through the following hack, you can split your categories’ list evenly into two or more columns which can save space and not make your pages longer. Usually in WordPress, the following code is used to call the categories’ list (you can find it in one of the sidebar files) :-
Now, we will try and split the categories into two columns. Replace the above code with the following :-
'; ';
$cats = explode("
",wp_list_categories('title_li=&echo=0&depth=1&style=none'));
$cat_n = count($cats) - 1;
for ($i=0;$i<$cat_n;$i++):
if ($i<$cat_n/2):
$cat_left = $cat_left.'
elseif ($i>=$cat_n/2):
$cat_right = $cat_right.'
endif;
endfor;
?>
Basically the above code will split your categories and put them into two lists (left and right). Now all you have to do is style them so that they float left of each other. Add this code to your style.css file :-
.right {float:left; width:140px;}
.left {float:left; width:140px;}
You might have to make some cosmetic adjustments in the above code so do it at your own pace.
Making Unobtrusive Tabs

If you have been following the latest trend of Premium WordPress themes, you will notice that special tabs are used (mostly in the sidebar part) to display different content like recent posts, comments, archives etc. When you click on any tab, only the content under that particular tab gets highlighted and the rest of the tabs’ content stays hidden. This allows the blog owner to display more content in less space.
Download this file :- Domtabs
Extract the domtab.js and domtab.css files from the archive and place it in your theme folder. Now add the following code in your header.php file above the tag :-
In order to show the tabs, add the following code anywhere in the template. Try adding it to the sidebars :-
You can change the content for the tabs by altering the code within the paragraph tags and edit domtab.css file for styling information.
Listing Blog Authors

If you are running a multi-user blog and want to list authors, here is the code to do it.
Here is what the parameters do :-
exclude_admin: 0 (include the admin’s name in the authors) / 1 (exclude the admin’s name from the list)
optioncount : 0 (No post count against the author’s name) / 1 (display post count against the author’s name)
show_fullname : 0 (display first name only) / 1 (display full name of the author)
hide_empty : 0 (display authors with no posts) / 1 (display authors who have one or more posts)
Displaying Categories in a Drop Down Menu

First, add the following code to any part of your theme to show the category list. The recommended choice will be your header.php file which contains the navigation. You can add this code where the navigation ends :-
Download this file :- Category Menu and extract both catmenu.css and catmenu.js files to your theme folder. Now, add the following lines to your header.php file before the tag :-
Finally replace
with
To see the category drop-down menu in action, make sure you have categories and sub-categories set up on your blog. Also make sure that they have some posts in them.
Displaying Google Ads in only first 3 posts

Many bloggers want to display Google Ads in their first three posts only (since Google Adsense only allows 3 strips in a page) but have a hard time doing so without the help of plugins. Let me tell you how to integrate it efficiently into your WordPress theme. Open up your index.php file and look for the loop.
The loop begins here (it can differ for your theme so look for the part that displays your blog posts) :-
and this loop should end like this :-
Sorry, nothing matches that criteria.
Ideally, your Google Adsense code should be placed between the start and the end of this loop. So, just pick a position (after the title or at the end of the content) and place the following code :-
current_post < 3) { ?>
Just replace the commented line with your adsense code, save this file and check your theme. It should display three units of adsense code in your first 3 posts just like you always wanted.
Displaying Recent Comments

In order to display your most recent comments, you will have to modify your functions.php file from the theme folder. If the functions.php file is not present, make a new text file, name it functions.php and add it to your theme folder. Add the following code to it and save the file :-
') { ";
function recent_comments($src_count=10, $src_length=60, $pre_HTML='
', $post_HTML='
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,
SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC
LIMIT $src_count";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
foreach ($comments as $comment) {
$output .= "
}
$output .= $post_HTML;
echo $output;
}
?>
Now, wherever in the theme you want to display the list of recent comments, just add this code :-
Highlighting Author Comments

It takes a bit of tweaking to separate the author’s comments from the readers’ comments. Usually it can be done by changing the color or style of the author’s comments. Here is how can go about doing the same :-
Open up the comments.php file from your theme folder and try to locate the following piece of code :-
Replace the above code with this :-
Finally, add this to your style.css file in the theme folder :-
.authorstyle {
background-color: #B3FFCC !important;
}
If you are the author and have made comments on a post, check it out. Your comments will have a different background color from the readers’ comments.
Adding a Social Bar to your Posts

Social bookmarking is important if you want your posts to reach more and more readers. Most of the times you have to hunt for a good plugin that will show little icons for different bookmarking websites under each of your posts that will help your readers to bookmark them. But it can also be done through code like this :-
Open the single.php file from your theme folder. Copy the following code and paste it within the WordPress loop (preferably after the content) that calls your post :-
Now, copy the following code to your style.css file for the theme :-
.socials {font-size:10px; font-weight:bold; margin-bottom:10px; background-color:#FFFFFF; border:1px solid #BBB9B2; padding:5px 5px 5px 10px; width:540px;}
.socials a {margin-right:10px; color:#BFBCB3;}
.btn_email {background:url(images/mail.gif) left no-repeat; padding-left:15px;}
.btn_comment {background:url(images/comments.gif) left no-repeat; padding-left:15px;}
.btn_delicious {background:url(images/delicious.gif) left no-repeat; padding-left:15px;}
.btn_digg {background:url(images/digg.gif) left no-repeat; padding-left:15px;}
.btn_reddit {background:url(images/reddit.gif) left no-repeat; padding-left:15px;}
.btn_technorati {background:url(images/technorati.gif) left no-repeat; padding-left:15px;}
.btn_furl {background:url(images/furl.gif) left no-repeat; padding-left:15px;}
Finally, download this zip file that contains the icon images for all the social bookmarking websites and place them in the images folder of your theme. Social Bar done
Creating an Archives Page for your Blog
![]()
You can create a Page Template for the archives page on your blog. Here is how to go about it :-
Create a new file called archives.php and add the following lines to it :-
/*
Template Name: Archive page
*/
?>
The above code will give a name (Archive Page) to the template which you will see when making a new page in WordPress. Now add the following code to display a list of all your posts :-
$posts_to_show = 100; //Max number of articles to display
$debut = 0; //The first article to be displayed
?>
Finally, add this code to display categories and monthly archives :-
Categories
Monthly Archives
Save the archives.php file and place it in your theme folder. Now, create a new page and name it anything you want. Just make sure that you choose the “Archive Page” template as the template for your new page.
I hope that you liked this exhaustive collection of WordPress hacks and also hoping that it will help you in some way








You know that you cannot see most of the codes on this page on a tablet, right?
Thank you for sharing such awesome tricks to make WP better and more customize. I’m using this on my WP site.
whats is wrong with my blog or code, any guide pleas?
Today, I went to the beach front with my children. I found a sea shell and gave it
to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and
screamed. There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is entirely off topic but I
had to tell someone!
the list was so helpful, i am glad to see one of my need for my new site. the social was great. love to see more of your list. Thanks a lot!
Hello! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll be bookmarking and checking back frequently!
The planet probably are hidden in addition to exotic smaller gardens might be maintained, and rainforest that is certainly certainly profligate with wide variety of facilities resembling golf game workshops, athletic courts and as a consequence swimming pools. Hotels Discounts
Was looking for a nice list builder for a directory I’m working on but found some other cool tools in the process. Thanks.
I was looking for a fix on my category column display and you came up in the results. this post is around 4 years old from the comments, and all the complaints about the code missing have been ignored. So I thought I would add another complaint to be ignored about your code being missing which makes the examples useless for a novice.
Good day! I know this is kinda off topic nevertheless I’d figured I’d ask. Would you be interested in exchanging links or maybe guest writing a blog post or vice-versa? My site goes over a lot of the same subjects as yours and I feel we could greatly benefit from each other. If you are interested feel free to shoot me an e-mail. I look forward to hearing from you! Excellent blog by the way!
can you please let me know that how did you set that social buttons at the end of the post where we roll over the icon and it stands up and comes out is there any plugin than please please let me know about it
thanks,
why cant I see most of the code snippets?
I already installed other theme on my blog http://www.bollywoodhungama24.in/ so according to this tutorial i have no such configurations to set hacks. Please suggest me to set archieves.
I dont want that !
is there any plugin that i can easily create a calender and then when a user click on the date then automatically comes the desire category .
interesting and detailed tutorial on WP. I am into StudioPress development, I guess using a framework to design sites have become much simpler.
Your places for code are fucked, half of them are empty (at least in chrome).
something went wrong there. thats too bad! I would love to see your hacks examples! could you please fix it?!
They’re empty in Firefox too.
Very thanks for creating such a useful post for all wordpress bloggers.
Hi ,
I love and use many wordpress hacks while i develop websites for my clients.
Thanks for sharing some of them here.
thanks for the help you give
Nice post, I especially like the tabs segment – I’m going to try that!
Thanks!
Claudia
yaayy! a god-send. I think the tabbed content is elegant and what css-oriented developers need.
Well, too sad! none aint working for my wordpress. I guess its because am using the latest version right?
good post.. nice word press hacks… i will use this tricks in my blog for sure
I really like the social bookmarking tip. Thanks for sharing.
This had made my blog simple, and more friendly to users.
Thanks for the tips.
very nice hacks, it really helps to customize things.
This list is quite helpful, thanks!
thank you … “adding social bar” article helps me alot …..
awesome
this information is exactly what I was searching for.
very nice content,i find what i need here tnx
i have a probleme with the STICKY POST, because now the post appears twice (in the loop ant at the top of the loop) ! any ideas ? thank you very much
These are some really nice hacks, thanks for sharing!
I’ve been looking for these, thanks for sharing.
with a little modification of this code, i made wonderfull result
thank you so much
if you want to create multiple columns of categories use
<?php
// Grab the categories – top level only (depth=1)
$get_cats = wp_list_categories( 'echo=0&title_li=&depth=1' );
// Split into array items
$cat_array = explode('’,$get_cats);
// Amount of categories (count of items in array)
$results_total = count($cat_array);
// How many categories to show per list (round up total divided by 5)
$cats_per_list = ceil($results_total / 4);
// Counter number for tagging onto each list
$list_number = 1;
// Set the category result counter to zero
$result_number = 0;
?>
<ul class="category_footer_post" id="cat-col-”>
<?php
foreach($cat_array as $category) {
$result_number++;
if($result_number % $cats_per_list == 0) {
$list_number++;
echo $category.'
‘;
}
else {
echo $category.”;
}
} ?>
FOR THE CSS
#cat-col-1 {float:left; width:180px;}
#cat-col-2 {float:left; width:204px;}
#cat-col-3 {float:left; width:204px;}
#cat-col-4 {float:left; width:180px;}
Example can be seen at http://www.Top30TvShows.com
i just import the blog from old domain to new one.
i try your code for category columns on seperate page () but nothing is displayed.
whats is wrong with my blog or code, any guide pleas?
Nice article! the best one: categories columns.
Unobtrusive Tabs <- didn't work, first everthing looked like normal except js was not working. Than I changed the storing place of js and it stopped working at all…
thanks, especially for splitting the categories into two column
Great tips! Thanks!
very nice post. thanx
Really useful post – I have been looking for a decent Category code and this is an ideal starting point. Thanks!
I found two of this hacks usefull for me. Thanks!
preety usfeul code tweaks, wp is really flexible this days
Jai,
These are extremely useful and cool hacks!!! Thanks for sharing these in your blog.
For the last few days, I have been trying to generate at least 3 category/sub-category columns using code from “Breaking Categories into Columns”. As part of the description, you mentioned “Through the following hack, you can split your categories’ list evenly into two or more columns which can save space and not make your pages longer.” I have not been successful in generating more than 2 columns and don’t know how to change the code to display more columns. Could you please let me know how to change the code to accomplish this task? Thank you in advance for your help in this matter; it is greatly appreciated!
By the way I want to displat Category Tab instead of Page Tab at the top. Can you help me how to do that plz…
thnx so much ,every hack is just in time for me…….
will category drop down work with thesis 1.6?
thank, I was looking for drop down categories stuff.
thank you so much!
I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work Look forward to reading more from you in the future.
Thank you for sharing your knowledge about wordpress.
I really liked this hacks. I will try to apply on my website.
great hacks!!
excellent tips which can really made my blogging life easy..
Your spot on directions for breaking categories into two listings worked PERFECTLY. Thanks for the post!
thanks for this great tips. i will use on one of my blogs.
Great tips, I love the idea of grouping the images, do you have any ideas?
Nice infor. Thanks for shared.
just let love be
Such a great post. I’ve been wondering how to get categories into 2 columns forever. Quick question –
How can you list categories in 2 columns AND show post counts? Can you guys post the code tweak? That would be amazing.
“…. and also hoping that it will help you in some way”
Thats purely an understatement. These tips have given me what I had been craving for all these days.
Thanks for taking time and writing this up.
Great tutorial boss. Thanx a lot for sharing.
thank for you manual
Really great tips… Am waiting to try most of these hacks on my own blogs.
Thanks again!!!
Thank you so much. This is SUPER helpful!!!
Hack to split categories is not working for me.. Please give me a solution…!!!
All the hacks are essential for a WordPress blog. I was looking for a hack to split categories into two columns and I found it here… Thanks for it
Hi good day,
I have followed your tip in creating archives. But it didn’t work out. Care to help me?
Please check my site, so that you’ll understand what i mean. Click on my monthly archives and see what does it do.
Please help me. Please
the archive template page was exactly what i was looking for. displaying display_category_as_images on that page will give me a great looking landing page. thanks!
Great hacks, will definitely use some. Thanks!
Thanks for a nice list.
Great “hacks” I like some of them
Nice tips! I love tweaking WordPress.
These are some small things that you wish for a easy option, but often end up trying to work around. This makes that easy option available.
Great one, thank you very much.
Nice tricks, i’ll implement it soon.
Thanks
Brilliant list of very useful tips. I especially like the Sticky Posts suggestion. Thanks.
Great, Thanks you so much.
thanks, great list, especially for splitting the categories into two column
Awesome, as a complete newbie, these are wonderful. I am thankful to a fellow student of Alex Jeffreys for giving out this link.
dear all,
this is what i was trying to look for some times, and finally found it…. however i couldnt find the ”php wp list categories(); ” in my blogger html codes, so can u please tell me if there’s any alternative solutions to split the list of links we have?
best regards
dear all,
this is what i was trying to look for some times, and finally found it…. however i couldnt find the ”” in my blogger html codes, so can u please tell me if there’s any alternative solutions to split the list of links we have?
best regards
dear all,
this is what i was trying to look for some times, and finally found it…. however i couldnt find the ”
” in my blogger html codes, so can u please tell me if there’s any alternative solutions to split the list of links we have?
best regards
awesome tips
I don’t know where this stuff goes? Open what? a template? what if it is a free tempate? how do I open it? Dreamweaver? do I cut/paste this code into the page? at what point?
I’m new to this and can’t find a clear set of instruction on how to use any of this code. Where do you people learn this stuff?
Help!!!!
Hey! I just don’t get it. My platform is wp, I have not upgraded cuz I don´t have credits, I seem unable to make changes to the style sheet. Also I can´t edit css so I guess what I’m trying to ask here is if I can actually change anything from my template without actually upgrading?
thanks lovely
Thank you very much, it’s very useful.
Can’t Stop to post Comment for Your Valuable Work……..
i m Recently shifted from blogger to wordpress…..
And This Post is a Boom for me
Thanks
Now i m gonna check your rest of post too
very good
Thankyou for this tutorial >.</
helpfull…
thanks alot
hi jay nice post
but i don’t found some thing here
how to change theme logo
noramal text >>> graphic logo
thanks if you also add this in this post
thanks
It’s very useful for creating a new theme. Tks. Salaam.
Instead of using the Sticky note.. you can also use the shantz-wp-prefix-suffix plugin “which allows you to add any text and/or HTML/CSS code to your posts and/or pages as prefix and/or suffix. (That includes even any new or old posts and pages and even your feed)”
http://wordpress.org/extend/plugins/shantz-wp-prefix-suffix/installation/
I use that plugin together with my Adsense Manager plugin.
= Awesomeness!
http://www.mutube.com/mu/getting-started-with-adsense-manager-3x/
Interesting that you used domtab in the example, whereas your themes use tabber. Why the switch?
Thank you for this useful information. I will use them in future.
I can see that even if I am not really much of a techie guy with wordpress hacks that you are indeed enjoying what you are doing.
My brother will like this because I know that he likes hacks a lot especially if it is WP coz he even had multiple templates designed for him just to have it under his name. I’m gonna give it a shot to let him know. Thanks, Bob….
Very nice tips, applied the Author comments and Social Hack. Planning to do the archives page as well
Great!
I love your post
amazing post
Amazing!
Yet another 10 awesome hacks, Jai. I’m going to implement those tabs on my sidebar right after this.
Yan
Those are awesome hacks–You actually helped me solve a really (small) issue with the social bar and one icon not showing. Thanks for this!
Wow, thanks for the brilliant hacks!
Nice Hacks !
I especially appreciate your archives page code.
Thnk you!
This list is quite helpful, thanks!
thanks you so much.. this is very cool.. keep sharing ^__^
very useful!
Thanks for the nice article. All tricks above obviously make my life even easier.
Great post…very informative.
Great, Thanks you so much. I’ve learned a lot and will make my wordpress blog more better
great
thanks so much
Nice work on all of these! I know what I’ll be implementing in to my sites tonight!
Thanks a lot for these plugins Jai
Nice Work
Totally awesome man!, this is what I’m looking for.
Thanks man
You have done this guides really good. Good job and keep going!
awesome guides!
many thanks!