Premium Wordpress Themes

Display Different Sidebars on Homepage and Single Posts in WordPress

The wordpress is a flexible tool with which you can build professional blogs and websites. More and more people use wordpress now and a lot of them want stylish unique layouts.As you know, it is a little hard for most of use to create a unique wordpress theme by ourselves, but still we need unique templates! Some of you may want to display different content on the sidebar between homepage and on the single posts,it is easy to do this.

<?php if (is_home()) {?><!– only display on the homepage  –>
<HERE IS THE CONTENT YOU WANT TO DISPLAY>
<?php }?>

THEN, WE CAN HAVE THESE:

<?php if (is_single()) {?><!– only display on the single posts  –>
<HERE IS THE CONTENT YOU WANT TO DISPLAY>
<?php }?>

<?php if (is_page()) {?><!– only display on the page –>
<HERE IS THE CONTENT YOU WANT TO DISPLAY>
<?php }?></code>

YES,THIS PHP CODE IS USEFUL. FOR EXAMPLE, IF YOU WANT TO <strong>DISPLAY FRIEND LINKS ON THE HOMEPAGE ONLY</strong>, YOU CAN ADD THIS:
<?php if (is_home()) {?><!– only display on the homepage  –>
<h3>LINKS</h3>
<ul>
<?php get_links(-1, ‘<li>’, ‘</li>’, ‘ – ‘); ?>
</ul>
<?php }?>

YOU SHOULD EDIT THE  sidebar.php