- This topic is empty.
-
AuthorPosts
-
August 11, 2013 at 6:55 am #146391Josh JohnsonParticipant
Hey,
What is the best way of controlling sidebar content? I have found in various projects that I have had 3-4 different sidebar files which is pretty hard to maintain from the WordPress admin.
I have made content editable by using the advanced custom fields option panel but that seems like cheating to me.
There must be an better way?
August 12, 2013 at 4:24 pm #146575SenffParticipantNot sure if it’s the BEST way, but the standard way is simply by using the available widgets. Drag them to the sidebar and configure them or fill them with content.
August 13, 2013 at 6:02 am #146651Josh JohnsonParticipantThat doesn’t work if you have 4 different types of sidebar though! It’s a frustrating one
August 13, 2013 at 8:26 am #146691AlenParticipantWhat exactly do you mean when you say:
controlling sidebar content?
Like from the user perspective: activating, editing, displaying?
Or from the developer perspective of managing the actual code, making it better, re-factoring?
With WordPress you can register different sidebars and just use the widgets section in admin to drag and drop different widgets.
August 13, 2013 at 8:50 am #146694SenffParticipantThat doesn’t work if you have 4 different types of sidebar though! It’s a frustrating one
Why not? It just gives you more options, so you can have more areas in your sidebar that can be controlled.
If you’re just looking for something more simple you can de-register certain sidebars so they won’t appear in the admin.
August 14, 2013 at 3:07 am #146767Josh JohnsonParticipantMaybe I have the wrong idea of the widget area in the WP backend but say I have five pages and on 2 of them pages I wanted a sidebar with ‘Related info’ for example and the other three pages I would like a sidebar with ‘Contact details’ – how would I differentiate which pages have which sidebar?
I thought that if you dragged a widget to the sidebar in the WP admin, it applies every widget to every page that has a sidebar enabled?
August 14, 2013 at 10:03 am #146816SenffParticipantsay I have five pages and on 2 of them pages I wanted a sidebar with ‘Related info’ for example and the other three pages I would like a sidebar with ‘Contact details’ – how would I differentiate which pages have which sidebar?
If you want SOME pages to show SOME sidebars, and then OTHER pages have OTHER sidebars, you’re going to have to do additional coding — or else all pages will show the same sidebar(s).
If you don’t feel comfortable with that, you really should check out @deeve007’s plugin suggestion.
August 14, 2013 at 2:54 pm #146844AlenParticipantYou’ll have to use conditional tags: http://codex.wordpress.org/Conditional_Tags
So something like:
if(is_page('about')) { get_sidebar('recent-news'); }
August 15, 2013 at 10:58 pm #147008gosingkParticipantHi there,
I understood your needs and if you would not willing to play with PHP coding stuff, just install this FREE plugin in wordpress:
After the installation, you can create unlimited sidebars and use different conditions to apply different sidebars to different pages just through the back-end admin UI, no need of any codings.
The way it works is you replace the default sidebar in the widget area with one custom sidebar you created for that particular page.
Hope it helps.
August 18, 2013 at 2:26 pm #147288Josh JohnsonParticipantI am comfortable coding multiple sidebars – I am uncomfortable with having the client come back to me when a sidebar widget needs changing.
I’ll have a look at that plugin @deeve007
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.