|
|
|
|
|
|
![]() |
#1 |
old enough to be Grandma Scrotum
|
Creating a post-specific sidebar
Thanks again to Walrus, I've discovered another way to tweak my blog so I thought I'd make a post about it for other lost souls such as myself.
You can code Wordpress so that the sidebar shows different things according to whether you're looking at a post or at the main page. The code is: Code:
<?php /* If this is the home page */ if (is_home()) { ?> <?php include (TEMPLATEPATH . '/nameofinclude1.php'); ?> <?php } ?> <?php /* If this is the post page */ if (is_single()) { ?> <?php include (TEMPLATEPATH . '/nameofinclude2.php'); ?> Say you want to link to a gallery pics in your sidebar but want one thing on the post page and something different on the main page. You'd create a separate php file with just the pic in it. You'd upload it into your theme directory and you'd change the name in the above code to whatever the include is called. I don't know if this post will help anybody but I was so proud of working it out I thought I'd share. I think I'm starting to get the hang of this ![]()
__________________
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|