The error you are getting is because you must add the registered sidebar to widgets_init
.
add_action( 'widgets_init', 'wpa199335_page_sidebar' );
function wpa199335_page_sidebar(){
register_sidebar(array(
'name' => __( 'Page Sidebar'),
'id' => 'page',
'description' => __( 'Displays on the side of pages with a sidebar' ),
'before_widget' => '<div class="widget">',
'after_widget' => '</div>',
'before_title' => '<h2 class="module-heading">',
'after_title' => '</h2>'
));
}
That will only register the area to put widgets into. For the sidebar to display on a page you will need to use the following in a template file or your functions.php
.
dynamic_sidebar( 'page' );
Related Posts:
- Get list of all registered sidebars
- dynamic_sidebar not rendering sidebar
- Get custom side bar on custom post archive page
- Custom sidebar not showing in the dashboard
- Sidebar Generator? :)
- How can you add a link to a sidebar description?
- unregister_sidebar() in stand-alone theme not working
- Creating a different side bar for single posts than for main page.
- Adding Multiple Sidebars
- How to increase maximum number of sidebars support?
- How to enable the default sidebar area?
- Sidebar widget not displaying after simple code update.
- Dynamic sidebar rendered in another place than i would like
- Dynamic Sidebar Conditional [duplicate]
- finding sidebar content in wordpress
- How to troubleshoot Sidebar not being generated
- Why is my custom sidebar always open on the widgets screen in Admin?
- Custom sidebars – get_sidebar() problems
- Content not showing up when using custom template + sidebar
- How to make sidebar float right and site content left
- Call Multiple Sidebars at once
- Why isn’t my registered sidebar showing up in the admin?
- List all sidebar names?
- What is the difference with get_sidebar and dynamic_sidebar?
- how do I get_sidebar into a varaible?
- Best way of making multiple sidebars
- How to get the name and description of a sidebar in theme?
- How to avoid widgets added to sidebar on theme activation?
- Adding content to sidebars
- Twenty Ten child theme has post on an inner page. Cant get that page to use my desired template
- Change sidebar headers from H1?
- Insert Widget option into mark-up with register_sidebar
- change sidebar or just widgets for 2 specific post type single posts
- How to add Sidebar and Full width option in post editor
- how to exclude posts on current page from recent posts sidebar widget
- How to add a class when there’s no sidebar?
- Custom page sidebar using Template dropdown box
- Register/Get sidebar?
- How to list custom post types in a secondary sidebar?
- From what hook on is it possible to conditionally add actions?
- Post thumbnails in sidebar & footer?
- Sidebar on the wrong side of the page
- Displaying Custom Sidebar Without Modifying Theme’s Core File?
- if statement in sidebar.php checking page id or template or title
- sidebar parameters (before_widget, before_title) not Working
- Remove Sidebar from WordPress [closed]
- Add #sidebar-2 to a custom page template
- Sidebar not appearing in footer, but it appears everywhere else!
- Common side bar for multiple websites
- Cannot retrieve author in sidebar of single.php
- Extra copy of sidebar appears in footer
- get_sidebar() will not work in footer.php
- Gutenberg get wp registered sidebars
- How do I show breadcrumbs when sidebar is not applied?
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- Create an array of “read next” posts using a dynamic offset
- Why the dynamic_sidebar() call is putted into an ul tag?
- How to use full length of the upper part of the content and below of it is a content with a sidebar?
- register_sidebar_widget is deprecated since version 2.8
- display specific sidebar for each role
- Sidebars are no longer working
- Change twentytwelve sidebar responsive relocation?
- Split the content of the_content();
- Why is registering a sidebar for each page causing my sidebars to reset?
- activate custom sidebar widgets
- Select a Sidebar from Page Creation
- is_user_logged_in function in a sidebar not working
- How do I set is_active_sidebar?
- How do I fully rid of the 1px wide sidebar border? [closed]
- how do i get my sidebar above content on nanomag theme
- How to create sidebar from “scratch”?
- How do I edit the side-bar (doesn’t seem to be a menu)?
- sidebar / widget wont show
- Sidebar widgets are looping out of the sidebar wrapper
- WordPress Bootstrap Grid
- Need help with theme Business (Modern Themes): sidebar issue
- Undefined index: custom_sidebars
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- Children Pages Displaying Only Intermittenty
- Extra sidebar in Twenty fifteen
- sidebar not displaying when using get data
- Echo there are no posts wp_get_archives
- How to change templates based on URL
- More than one dynamic sidebar
- How to add banners in sidebar of my theme [duplicate]
- Sidebar does not display on blog page, but fine with static pages
- is_home() and is_front_page() not working in sidebar
- Placing video content into a sidebar
- different contents and same sidebar approach?
- Add the title of a widget as an ID – for anchor links
- How to hide a Sidebar from other admins?
- How to create another sidebar to be shown on another page?
- How to change font in title of sidebar widget [closed]
- How do I load my site without the side bars? This is for an app
- How do I move the sidebar more to the right in TwentySeventeen?
- Remove Sidebar for Pages on Canvas Wootheme [closed]
- How can I add custom sidebar to my theme? [closed]
- How to hide sub categories in sidebar [closed]
- sidebar choice not saved for pages (but saved ok for posts/custom posts) [closed]
- Disappearing Widget Text area