Forums

[resolved] accessing sidebar 0? (5 posts)

  1. myinstinctwaswrong
    Member
    Posted 3 years ago #

    when I am in Design | Widgets, over on the right is a drop down to view the Current Widgets by Sidebar. I get a choice of Sidebar 1, or SideBar 2 - is there any way to access Sidebar 0 here? or is that reserved for something else? or a function of theme design?

  2. Otto
    Tech Ninja
    Posted 3 years ago #

    The theme defines what the sidebars are named. If it doesn't give a specific name, WordPress names them Sidebar 1, Sidebar 2, Sidebar 3, and so on.

    There is no sidebar zero unless the theme defines one explicitly.

  3. myinstinctwaswrong
    Member
    Posted 3 years ago #

    thanks - my theme (blacksplat) does have references to Sidebar 0 - looking at sidebar.php it appears to be static - no call like

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar0') ) : ?>

    but those calls do exist for sidebar 1 and 2

    am I correct when I say that only dynamic sidebars show up in the Design | Widgets screen drop-down selector?

  4. Otto
    Tech Ninja
    Posted 3 years ago #

    In the theme's functions.php file, it will define what sidebars that theme has by calling register_sidebar or register_sidebars. That's where the sidebar names get defined.

    The dynamic_sidebar('whatever'); displays those sidebars by name.

  5. myinstinctwaswrong
    Member
    Posted 3 years ago #

    thank you again. I converted sidebar0 to a dynamic sidebar, registered it in functions.php, then had to do a little widget reorganizing, but all is as I wanted it now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags