Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Best way of controlling sidebar content in WordPress

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #146391
    Josh Johnson
    Participant

    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?

    #146575
    Senff
    Participant

    Not 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.

    #146651
    Josh Johnson
    Participant

    That doesn’t work if you have 4 different types of sidebar though! It’s a frustrating one

    #146691
    Alen
    Participant

    What 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.

    http://codepen.io/anon/pen/dybjk

    #146694
    Senff
    Participant

    That 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.

    #146767
    Josh Johnson
    Participant

    Maybe 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?

    #146816
    Senff
    Participant

    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?

    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.

    #146844
    Alen
    Participant

    You’ll have to use conditional tags: http://codex.wordpress.org/Conditional_Tags

    So something like:

    if(is_page('about')) { get_sidebar('recent-news'); }
    
    #147008
    gosingk
    Participant

    Hi there,

    I understood your needs and if you would not willing to play with PHP coding stuff, just install this FREE plugin in wordpress:

    WooSidebars

    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.

    #147288
    Josh Johnson
    Participant

    I 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

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Back End’ is closed to new topics and replies.