sidebar.php question: filtering sidebar dependent on page
-
Hi all,
I am having a slight problem with my sidebar.php, for some reason in author.php my sidebar shows 2 sidebars (seems to include the one I use for archives also). See here: http://www.elyonline.co.uk/archives/author/mm/
This is how my sidebar.php looks like (I have taken out all the sidebar items to make things clearer). http://pastebin.com/530704
Any suggestions as to why it is feeding 2 sidebars in author.php?
Also can I have a sidebar incorporated here for non-wp pages that use:
<?php/* Use WP Templating System */
require(‘../news/wp-blog-header.php’);
?>All the best
Karl
-
I don’t normally *bump* but I really nned some help on this guys.
Thanks a lot
did you remember to remove/delete
<?php get_sidebar(); ?>from your author.php before you inserted your new call for alternative sidebar?is_archive() is a bit pushy, in that it considers category and author queries to be archive-related, too (ok, so it’s not all wrong here). To deal with that, change your is_archive() line to:
<?php if(is_archive() && !(is_category() || is_author())) { ?>katie1, yes thanks 🙂
Kafkaesqui, as usual you are a star, that worked a treat 🙂
Kaf, can I have a sidebar incorporated here for non-wp pages that use:
<?php/* Use WP Templating System */
require(‘../news/wp-blog-header.php’);
?>at present I think the single.php page pulls in as you see here: http://www.elyonline.co.uk/contact/
All the best
KarlKaf,
With regards to category in sidebar. Can I create sidebar content for one category if I am using category-id.php page?
Would it be <?php if(is_category(‘id_here’))) { ?>
Thanks
KarlThat *should* work (though you have an extra ) in your if statement
:). See the Codex info on is_category:
The topic ‘sidebar.php question: filtering sidebar dependent on page’ is closed to new replies.