[wp-testers] is_home problem

Jeremy Visser jeremy.visser at gmail.com
Thu Sep 28 05:01:21 GMT 2006


On Wed, 2006-09-27 at 22:17 -0500, Conrad - Conrad_Vanl wrote:
> On the alpha 2.1 release when I'm trying to show a different sidebar on the
> homepage then on other pages. To do this I've simply included in my
> sidebar.php file:
> 
> <?php if (is_home()) { ?> (my sidebar stuff here) <?php } ?> 
> 
> But nothing shows up. No if I put 2 or more items in the if statement, for
> instance: 
> <?php if (is_home() || is_archive('blog') ) { ?> it works like it should.
> 
> But that's not what I want. I would like it to be visible only on the home
> (index.php) page. I have another if statement in the header.php that refers
> to is_home and it works like a charm. Why isn't this working in my sidebar?

This isn't what you expect to hear, but Sidebar Modules [1] makes it
really easy. The plugin allows you to change your sidebar by adding
standard "blocks" or "modules" such as Search, Archives, Categories.
Plus, you can add HTML or PHP blocks.

Each module has an option to tell it what page to display on, e.g. the
home page or an archive or category. See the screenshot at [2] to see
what I'm talking about.

[1] http://nybblelabs.org.uk/projects/sidebar-modules/
[2] http://nybblelabs.org.uk/wp-content/uploads/2006/07/sbm-ss2.png

-- 
Jeremy Visser 
Email: jeremy.visser at gmail.com GPG id: CF13C41A
Website: http://narnia.bounceme.net/jeremy/



More information about the wp-testers mailing list