Support » Fixing WordPress » Different Sidebars in Single Post?
Different Sidebars in Single Post?
-
hi,
i’m having a problem thats been urking me for the last little while. in single posts, my sidebar is the same as the sidebar on the main blog page. how do i customize my single post sidebar? i’ve been looking right and left and have tried a million things but nothing seems to work.
the reason i need my single post sidebar to be customized is because the sidebar seems to run on too long if i’m posting short posts, thus causing my page to look.. well… weird. to further illustrate my problem, i posted a picture below. someone PLEEEEASE help me!
-
1. create a new sidebar, call it sidebar-something.php
2. in single.php add : <?php get_sidebar(‘something’); ?>Correction :
1. create a new sidebar, call it sidebar-something.php
2. in single.php
replace <?php get_sidebar(); ?>
by
<?php get_sidebar(‘something’); ?>sorry.. i’m a total newb. how do i create a new sidebar php?
Copy your existing sidebar.php to sidebar-something.php and then edit as suggested.
Resources:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchyedit
ok i replaced the original sidebar.php with the new one and now i get 2 sidebars…
Hi, I’m having a similar issue, but a bit more complicated. I have created different sidebars for each of my category pages and I would like the posts in a specific category to display the category sidebar. I’m assuming I need to add some form of “if” statement to what you have above, but my coding ability from scratch is limited.
any help? my site is here http://thecostaricanews.com
Thanks in advance.
- The topic ‘Different Sidebars in Single Post?’ is closed to new replies.