Custom sidebar for pages
How do I create my sidebar so that I can have a widget which has links to certain pages depending on what page the viewer is on?
eg when on Page 1 it has links to pages 2,5,10
when on page 2 it has links to pages 3,4,8
I’m using the suffusion theme and I can’t seem to work out a way of customising the sidebar for specific pages. I’m not very goof with code so a simple solution would be ideal.
Thanks in advance
i’m trying to do the same thing and have just the parent and child pages of the page you’re on to appear in the sidebar, excluding the other parent and child pages. i’ve checked all of your suggestions here, and searched through all the sidebar customization help, but none of the solutions seem to allow this. is it possible to edit the sidebar pages widget to include an if/then statement that shows only the parent and child pages you’re on and not the other parent and child pages, or, if i were to create unique sidebar.php pages for each pages section–how would i direct the pages to see their unique sidebar.php page?
i’m not sure i’m saying any of this right, any help would be much appreciated.
connormccandless and sosafait – you’ll want to look at the examples in the wp_list_pages() article and either use a php-code widget or modify a sidebar.php to do that.
thank you for responding…i looked at this, but none of the above widgets allow for this when you’re using the same page template. i also saw the wp_list_pages() article page, but for a non-php coder this is extremely confusing. i’ve also enabled the pages sidebar widget and would try editing that code in the php widget, but i can’t figure out how to get the code.
you suggested modifying the sidebar; this is also confusing. i’ve tried to create page templates for the different parent pages and call to unique sidebar files, but i couldn’t figure out why it wasn’t working as the code is too deep for me.
i appreciate your help.
There is a plugin ( i wrote it) called Custom Sidebars you may like to have a look at
The plugin allows to have multiple sidebars without writting any code, and in few clicks you can create, widgetize, and set sidebars up for post and pages individually or for all the post of a post-type.
In your case, you should create 2 sidebars with the differents links to your post, and assign them to the pages you need.
Marquex – I installed your plugin, and in theory it is exactly what I needed, but in practice I cannot make heads or tails of the instructions or figure out how to get this to work correctly. 🙁 Maybe I am dumb, or maybe just too impatient because I have a tight deadline on this project so I don’t have the time to try and figure this out. Sorry, but I just find the user interface for this plugin is very non-intuitive.
//// EDIT //// – I see now that the problem is my expectation was to ADD an alternative sidebar to hold certain widgets for certain pages, and this plugin is meant to only REPLACE existing sidebars. I want to keep the sidebars I have now as common sidebars sitewide, then only add another sidebar on certain pages. /////
- The topic ‘Custom sidebar for pages’ is closed to new replies.