I have a site which is all powered by Wordpress. I have a normal sidebar which is contained in sidebar.php. On the actual blog section, I want to put archives in the sidebar; however, I only want it on the blog section (and not the rest) Does anyone know how I can do this, or where I could find this info? I've seen it done before, just (obviously) can't see their source too see what they've done. Cheers
There are 4 pages: - Home - About - Blog - Contact So if I use is_home() then will it work for the blog homepage, or the actual homepage homepage?
It will only be on the home page , for the pages you should test with : is_page() and i agree with Meethere , your question is a bit confusing ...
Everything is wordpress. Homepage is like "welcome to our site" - its not actually displaying any blog posts, and has a different sidebar (sponsors, because its a free site for a charity) On the blog section though, want to have archives in the sidebar instead of the sponsors. Make sense? If I knew what I was doing it would make more sense!
<?php if (is_home() || is_page()) { ?> <!-- your archive as mention --> <?php } else { ?> <!-- alterante if not home and page --> <?php } ?> Code (markup): or for more multi choice <?php if (is_home() || is_page()) { ?> <!-- your archive as mention --> <?php } else if (is_category() || is_single()) { ?> <!-- alterante to show thing in cat and single --> <?php } ?> Code (markup): try it out