It’s pretty easy to enhance your sidebar to appear differently on the homepage and single post. A different sidebar in single post is useful when you want to switch what reader see in homepage (a widget may be) into an ads to monetize your blog.
The steps are simple and I will share you the tutorial in a 1-2-3 steps.
To make this tutorial simple, I will use my current theme that I’m using now to make the modification (Super Adsense Theme by Gobala Krishnan)
Starting from Preparation:
Open up your FTP Client Application and Login to your Web Server.- Point to your Wordpress Theme Folder to download the following files:
- single post
- Sidebar
- l_sidebar (there are 2 files, l_sidebar and r_sidebar. It’s up to you to choose which one you are going to modify)
(located in: wp-content/themes/[theme_file_name]/)
- After downloading, save it in a folder and name it properly to avoid confusion. Create a back-up files if you don’t want to mess things up. Now you will edit everything offline.
Start Editing the Single Post File:
- In the folder window, start by right clicking on the single post file (single.php) and select [open with...]. Choose Wordpad or Notepad to edit the file.
- Scroll through the end of the code, you will see a line of code like this:
</div>
<?php get_sidebar(); ?>
<?php get_foote(); ?> - Make a change to the code to:
</div>
<?php includ 'singlesidebar.php'; ?>
<?php get_footer(); ?> - Save as single.php (no file name change because you are going to overwrite the existing file in your server) and close it.
Editing the Sidebar File:
- Right Clicking on the Sidebar file (sidebar.php) and open it with your favorite text editor.
- You will see the following code:
<div id="sidebar">
<?php include (TEMPLATEPATH . '/l_sidebar.php‘); ?>
<?php include (TEMPLATEPATH . ‘/r_sidebar.php’); ?>
</div> - Change the code into the following code:
<div id="sidebar">
<?php include (TEMPLATEPATH . '/single_l_sidebar.php‘); ?>
<?php include (TEMPLATEPATH . ‘/r_sidebar.php’); ?>
</div> - Save as singlesidebar.php and close it.
Editing the last file - l_sidebar.php:
- Right Clicking on the file l_sidebar.php inside the folder and open it again with your favorite text editor.
- You will see the code of the current display of the sidebar in superadsense theme. Change it to something you like, add and remove as you wish. It’s your sidebar for your single post view, so please consider well what you want to put and remove.
- Finally, Save the file as single_l_sidebar.php and close all the windows (except your FTP client window).
Uploading steps:
- Go to your FTP Application. Re-open if you have close it.
- Point to the folder that containing the modified .php files:
- single.php
- singlesidebar.php
- single_l_sidebar.php
- Upload 3 of them to your web server in this location:
- wp-content/themes/[theme_file_name]/
- overwrite the single.php file
- Well Done!
Yup, now you will have a different sidebar in your single post view. Have Fun!
Attention: You many not be able to use this tips if you are a sidebar_widget user. It may crash because the sidebar is different now.
Update:
One every Thursday, you will enjoy several tips and tricks to increase your techie side in blogging. Get prepare to code some page and learn some design skills to improve your blog “looks and feels”.
Consider to subscribe to the feed or via email to receive update, tips and tricks to make sure you don’t miss one.

Now Reading ...
Stumble it!
Del.icio.us it!
Digg it!
Leave a comment








(October 8, 2007, 3:51 am)
Simple and effective tutorial for all people who are not comfortable editing the php files. Stumbled.
Reply to Nirmal(October 8, 2007, 5:21 am)
Thanks for the stumble!
Reply to Ken XuI hope beginner could make a good use of it. I will update for more tutorial on free WPtheme since SuperAdsense is a paid theme ($7).