Widget Areas
Free themeEvery place in BuddyX where you can drop a widget, what each one is called, and what has to be switched on before it shows up.
Documented against BuddyX 5.2.0 (Free). Widget areas are not Customizer options. You fill them at Appearance > Widgets. The layout options that show or hide them are in Appearance > Customize > Sidebar.
What a Widget Area Is
A widget area is a named slot in the theme. You put widgets into it under Appearance -> Widgets, and the theme prints whatever is in that slot when it renders the matching page.
BuddyX registers 20 widget areas in total. Only six of them exist on a plain WordPress install. The other 14 are registered only when a specific plugin is active, so the list you see on the Widgets screen depends on which plugins you run.
Two things have to be true before a widget area shows on the front end:
- The area has to be registered, which depends on the plugin conditions in the tables below.
- The area has to be displayed, which for most areas is decided by a sidebar layout setting in the Customizer.
An area with widgets in it and its layout set to "No sidebar" prints nothing. That is the most common reason a widget looks like it disappeared.
Where to Add Widgets
- Go to Appearance -> Widgets.
- Find the widget area by name in the list.
- Add your widgets to it.
- Save.
You can also work at Appearance -> Customize -> Widgets if you want a live preview while you edit.
BuddyX does not change which widget editor WordPress gives you. On WordPress 5.8 and later that is the block widget editor, unless you or a plugin have switched it back to the classic one.
Widget Areas That Are Always There
These six are registered no matter which plugins you run.
| Widget area name | ID | Where it appears |
|---|---|---|
| Left Sidebar | sidebar-left |
The left column on posts, pages, archives, and search, when the matching sidebar layout is set to Left or Both. |
| Right Sidebar | sidebar-right |
The right column on posts, pages, archives, and search, when the matching sidebar layout is set to Right or Both. |
| Footer 1 | footer-1 |
First footer column. |
| Footer 2 | footer-2 |
Second footer column. |
| Footer 3 | footer-3 |
Third footer column. |
| Footer 4 | footer-4 |
Fourth footer column. |
The four footer areas have no Customizer setting behind them. The footer counts how many of footer-1 to footer-4 actually contain widgets and prints only those, so an empty column collapses instead of leaving a gap. If all four are empty, the .footer-inner block is skipped entirely, so no widget row is printed. The outer .site-footer-wrapper container is still output.
BuddyPress Widget Areas
These eight are registered only when BuddyPress is active.
| Widget area name | ID | Where it appears |
|---|---|---|
| Community Left Sidebar | buddypress-sidebar-left |
Left column of the activity, members, and groups directories, when that directory's sidebar layout is set to Left or Both. |
| Activity Directory Right Sidebar | buddypress-sidebar-right |
Right column of the activity directory, when Activity Directory Sidebar Layout is Right or Both. |
| Members Directory Right Sidebar | buddypress-members-sidebar-right |
Right column of the members directory, when Members Directory Sidebar Layout is Right or Both. |
| Groups Directory Right Sidebar | buddypress-groups-sidebar-right |
Right column of the groups directory, when Groups Directory Sidebar Layout is Right or Both. |
| Members Single Profile Sidebar | single_member |
Sidebar on a member profile. |
| Members Single User Activity | single_member_activity |
Sidebar on a member's own activity tab. |
| Groups Single Group Sidebar | single_group |
Sidebar on a single group. |
| Groups Single Group Activity | single_group_activity |
Sidebar on a single group's activity tab. |
Note the ID pattern breaks on the last four: they use underscores (single_member, single_group) rather than the hyphenated slugs the directory areas use. That matters if you are targeting them in code.
The four single-item areas behave differently
The four directory areas follow the Customizer layout settings. The four single-item areas do not have a layout setting at all. They render whenever they contain widgets and the visitor is on the matching screen, with these conditions:
- Members Single Profile Sidebar is skipped on the member Settings, Messages, Notifications, Profile Edit, Change Avatar, Change Cover Image, front page, and Invitations screens. It shows on the remaining profile screens.
- Members Single User Activity and Groups Single Group Activity only render when BuddyPress Nouveau's vertical navigation option is off. BuddyX checks the
user_nav_displayandgroup_nav_displayvalues in BuddyPress's Nouveau appearance settings first, because with the vertical nav on, the nav itself occupies that column. - Groups Single Group Sidebar renders on any single group screen once it has widgets.
bbPress Widget Areas
Registered only when bbPress is active.
| Widget area name | ID | Where it appears |
|---|---|---|
| bbPress Left Sidebar | bbpress-sidebar-left |
Left column on forum pages, when bbPress Sidebar Layout is Left or Both. |
| bbPress Right Sidebar | bbpress-sidebar-right |
Right column on forum pages, when bbPress Sidebar Layout is Right or Both. |
WooCommerce Widget Areas
Registered only when WooCommerce is active.
| Widget area name | ID | Where it appears |
|---|---|---|
| WooCommerce Left Sidebar | woocommerce-sidebar-left |
Left column on the shop archive and single product pages, when WooCommerce Sidebar Layout is Left or Both. |
| WooCommerce Right Sidebar | woocommerce-sidebar-right |
Right column on the shop archive and single product pages, when WooCommerce Sidebar Layout is Right or Both. |
FluentCart Widget Areas
Registered only when FluentCart is active. The theme checks for the FLUENTCART_PLUGIN_FILE_PATH constant, so an installed-but-deactivated FluentCart does not register them.
| Widget area name | ID | Where it appears |
|---|---|---|
| Single Product Left Sidebar | fluentcart-sidebar-left |
Left column on a single FluentCart product page, when Single Product Sidebar is Left or Both. |
| Single Product Right Sidebar | fluentcart-sidebar-right |
Right column on a single FluentCart product page, when Single Product Sidebar is Right or Both. |
These two are named "Single Product Left Sidebar" and "Single Product Right Sidebar" on the Widgets screen, not "FluentCart ...". If you run both WooCommerce and FluentCart you will see two similar-looking pairs in the list. The WooCommerce pair is the one with "WooCommerce" in the name.
Settings That Control Whether a Sidebar Renders
Path: Appearance > Customize > Sidebar. See Sidebar for what each option is for.
Each layout control offers the same four choices: No sidebar, Left sidebar, Right sidebar, Both sidebars. The plugin-specific rows only appear when that plugin is active.
| Setting | Setting ID | What it controls |
|---|---|---|
| Sidebar Layout | sidebar_option |
Left Sidebar / Right Sidebar on pages, archives, and search. Default: right |
| Single Post Sidebar Layout | single_post_sidebar_option |
Left Sidebar / Right Sidebar on single blog posts. Default: none |
| Activity Directory Sidebar Layout | buddypress_sidebar_option |
Community Left Sidebar and Activity Directory Right Sidebar on the activity directory. Default: both |
| Members Directory Sidebar Layout | buddypress_members_sidebar_option |
Community Left Sidebar and Members Directory Right Sidebar on the members directory. Default: right |
| Groups Directory Sidebar Layout | buddypress_groups_sidebar_option |
Community Left Sidebar and Groups Directory Right Sidebar on the groups directory. Default: right |
| bbPress Sidebar Layout | bbpress_sidebar_option |
The two bbPress areas on forum pages. Default: right |
| WooCommerce Sidebar Layout | woocommerce_sidebar_option |
The two WooCommerce areas on shop and product pages. Default: right |
| Single Product Sidebar | fluentcart_product_sidebar |
The two FluentCart areas on single product pages. Default: none |
| Sticky Sidebar | sticky_sidebar_option |
Whether a sidebar stays in view as the reader scrolls. Default: On |
The four footer areas and the four BuddyPress single-item areas have no setting in this list. They are governed by whether they contain widgets, plus the screen conditions described above.
Use Cases
A course site running LearnDash. BuddyX free does not register a LearnDash widget area, and there is no LearnDash sidebar layout control. Course, lesson, and quiz pages follow the general Sidebar Layout setting and draw from Right Sidebar or Left Sidebar. Put your course navigation, progress, or support-contact widgets in Right Sidebar and they show across the whole site including the course pages. If you need a course-only widget set, that is a BuddyX Pro feature.
A paid community on BuddyPress. Set Activity Directory Sidebar Layout to Both. Put a welcome message and community rules in Community Left Sidebar, and your "who is online" and "recently active" widgets in Activity Directory Right Sidebar. Add a members-only announcement widget to Members Single Profile Sidebar so it appears on every profile screen except the private ones (Settings, Messages, Notifications). If your community uses BuddyPress Nouveau's vertical navigation, skip Members Single User Activity, because that area is not rendered while the vertical nav is on.
A vendor marketplace on WooCommerce. Set WooCommerce Sidebar Layout to Left. Put product categories, a price filter, and a product search widget in WooCommerce Left Sidebar. It shows on the shop archive and on single product pages, and nowhere else, so your blog and community pages keep whatever the general Sidebar Layout gives them.
A support site with forums. With bbPress active, set bbPress Sidebar Layout to Right and put a forum search widget and a "recent replies" widget in bbPress Right Sidebar. Keep the general Sidebar Layout on Right with a different widget set, and the two never mix.
Troubleshooting
I added widgets but nothing shows on the page
Check the layout setting for that context under Appearance -> Customize -> Sidebar. If it is set to No sidebar, the column is not printed at all, no matter what is in the widget area. Set it to Left, Right, or Both.
I cannot find a widget area that the documentation mentions
The plugin-specific areas only exist when the plugin is active. Activate BuddyPress, bbPress, WooCommerce, or FluentCart and reload Appearance -> Widgets.
Where is the LearnDash Sidebar?
BuddyX free registers no LearnDash or LearnPress widget area. Those sidebars are in BuddyX Pro, and Appearance > Getting Started > Free vs Pro lists LearnDash Sidebar under Site Sidebar as a Pro setting.
My footer columns are uneven
The footer prints only the columns that contain widgets. If you fill Footer 1 and Footer 3 but leave Footer 2 empty, you get two columns, not a gap in the middle. Move your widgets into consecutive areas if you want a specific column order.
The single member or group activity sidebar does not render
Those two areas are skipped while BuddyPress Nouveau's vertical navigation is enabled. Check the user_nav_display and group_nav_display options in BuddyPress's Nouveau appearance settings.
For Developers
Where registration happens
Every widget area in the free theme is registered in one place:
- File:
inc/Sidebars/Component.php - Class:
BuddyX\Buddyx\Sidebars\Component - Method:
action_register_sidebars(), hooked towidgets_init
There are no register_sidebar() calls anywhere else in the free theme. The component is instantiated in inc/Theme.php, so registration always runs.
Slug constants
inc/Sidebars/Component.php exposes the hyphenated IDs as class constants:
LEFT_SIDEBAR_SLUG = 'sidebar-left'
RIGHT_SIDEBAR_SLUG = 'sidebar-right'
BUDDYPRESS_LEFT_SIDEBAR_SLUG = 'buddypress-sidebar-left'
BUDDYPRESS_RIGHT_SIDEBAR_SLUG = 'buddypress-sidebar-right'
BUDDYPRESS_MEMBERS_RIGHT_SIDEBAR_SLUG = 'buddypress-members-sidebar-right'
BUDDYPRESS_GROUPS_RIGHT_SIDEBAR_SLUG = 'buddypress-groups-sidebar-right'
BBPRESS_LEFT_SIDEBAR_SLUG = 'bbpress-sidebar-left'
BBPRESS_RIGHT_SIDEBAR_SLUG = 'bbpress-sidebar-right'
WOOCOMMERCE_LEFT_SIDEBAR_SLUG = 'woocommerce-sidebar-left'
WOOCOMMERCE_RIGHT_SIDEBAR_SLUG = 'woocommerce-sidebar-right'
FLUENTCART_LEFT_SIDEBAR_SLUG = 'fluentcart-sidebar-left'
FLUENTCART_RIGHT_SIDEBAR_SLUG = 'fluentcart-sidebar-right'
The four footer IDs and the four BuddyPress single-item IDs are written as literals in the registration method and have no constants.
Widget markup
Every area wraps each widget the same way:
<section id="%1$s" class="widget %2$s"> ... </section>
Widget titles differ by area. The four footer areas use <h3 class="widget-title">. Every other area uses <h2 class="widget-title">.
Template tags
Sidebars\Component::template_tags() exposes an is_*_active() and a display_*() pair for each of the 12 constant-backed areas, reachable through the buddyx() helper:
buddyx()->is_right_sidebar_active();
buddyx()->display_right_sidebar();
buddyx()->display_buddypress_left_sidebar();
buddyx()->display_buddypress_members_right_sidebar();
buddyx()->display_buddypress_groups_right_sidebar();
buddyx()->display_bbpress_left_sidebar();
buddyx()->display_woocommerce_right_sidebar();
buddyx()->display_fluentcart_right_sidebar();
The four footer areas and the four BuddyPress single-item areas have no template tag. Templates call dynamic_sidebar() on them directly.
Which template renders which area
| Area | Template |
|---|---|
| Left Sidebar, Right Sidebar | index.php, single.php, page.php, archive.php (rendered inline, not through get_sidebar()) |
| Community / directory areas | sidebar-buddypress.php, pulled in by buddypress.php |
single_member, single_member_activity |
buddypress/members/single/home.php and bb-buddypress/members/single/home.php; single_member is also rendered by rtmedia/main.php |
single_group, single_group_activity |
buddypress/groups/single/home.php and bb-buddypress/groups/single/home.php; single_group is also rendered by rtmedia/main.php |
| bbPress areas | bbpress.php |
| WooCommerce areas | woocommerce/archive-product.php, woocommerce/single-product.php |
| FluentCart areas | single-fluent-products.php |
| Footer 1 to Footer 4 | footer.php |
sidebar.php exists but is only pulled in by the templates in optional/, which are not part of the active template hierarchy. Overriding sidebar.php in a child theme will not change the main templates.
Actions you can hook
buddyx_sidebar_beforeandbuddyx_sidebar_afterfire insidebar-buddypress.phpandsidebar.php.buddyx_before_contentandbuddyx_after_contentbracket the main content and sidebar block inindex.php,bbpress.php,single-fluent-products.php, and the other main templates.buddyx_footer_beforeandbuddyx_footer_afterbracket the<footer id="colophon">element infooter.php.
Body classes
Sidebars\Component::filter_body_classes() adds a class when an area is active and the matching layout setting agrees:
has-sidebar-left / has-sidebar-right / has-sidebar-both
has-buddypress-sidebar-left / has-buddypress-sidebar-right / has-buddypress-sidebar-both
has-bbpress-sidebar-left / has-bbpress-sidebar-right / has-bbpress-sidebar-both
has-woocommerce-sidebar-left / has-woocommerce-sidebar-right / has-woocommerce-sidebar-both
has-fluentcart-sidebar-left / has-fluentcart-sidebar-right / has-fluentcart-sidebar-both
has-single-member-sidebar
has-single-member-activity-sidebar
has-single-group-sidebar
has-single-group-activity-sidebar
The class is skipped on the front-page.php, 404.php, 500.php, and offline.php templates. A separate sticky-sidebar-enable class comes from sticky_sidebar_option.
CSS handles
Sidebar and widget styling ships as two handles, printed on demand by buddyx()->print_styles():
| Handle | File |
|---|---|
buddyx-sidebar |
assets/css/sidebar.min.css |
buddyx-widgets |
assets/css/widgets.min.css |
Each sidebar column is an <aside> with an inner <div class="sticky-sidebar">. The left column is <aside id="secondary-left" class="left-sidebar widget-area"> and the right column is <aside id="secondary" class="primary-sidebar widget-area">, so a page with both sidebars never repeats an id.
Related
- Sidebar - the layout controls that decide where a sidebar sits
- Footer and Copyright - the footer columns and copyright bar
- BuddyX documentation home
Got a question? We're a friendly team - happy to help.
- Visit our Documentation Portal
- Email us at support@wbcomdesigns.com