You have to add this code in the functions.php
file:
/**
* Register new sidebar
*
*/
function new_sidebar_widget_init() {
register_sidebar( array(
'name' => 'new-sidebar',
'id' => 'new-sidebar',
'before_widget' => '<div id="new-sidebar">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'new_sidebar_widget_init' );
and then call the sidebar from a template to display it:
<?php dynamic_sidebar( 'new-sidebar' ); ?>
Related Posts:
- Switching themes without losing widgets?
- can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn’t run
- Moving WordPress.com theme and widget settings to self-hosted site?
- Why are my widgets not saving when being added to a sidebar?
- Duplicate and change a Theme Widget
- Current theme broken – after server and domain migration
- Changing $before_widget for certain widgets
- adding multiple sidebars on pages
- Embedded Videos (PB) – Not Available
- Hide default “Recent Comments” Widget if there are no comments yet
- Widgets menu does not appear under “Appearance” in dashboard
- Calling widget via function in themes files (hard code)
- Inject widgets from one sidebar into another with PHP
- How to conditionally display widgetized areas in theme customizer?
- Displaying a widget in sidebar only when no other widgets rendered?
- Style the archives/category sidebar widget via theme
- Restrict access to specific widget field based on user role
- Modifying the markup in the Tag Cloud widget?
- How to override / customize existing Widgets?
- Widgets not showing on sidebars
- Using filter in the widget causes fatal error
- disable default widgets in Responsive theme
- What happened to my Inactive Widgets?
- In a specific blog, the K2 theme does not have a Text Widget
- Removing a widget via theme editor
- sidebar in 2020 theme as a widget
- How to customize a section of a widget only on certain pages or page
- Changing theme folder name disrupts widgets
- No “available widgets” (wordpress 3.2.1 multisite)
- Opinions and recommendations on the best barebones base theme [closed]
- How to change the language for the front-end only?
- Different template of products for specific category. WooCommerce
- How to use media upload on theme option page?
- WordPress 5 / Gutenberg – theme doesn’t have featured image option showing up
- How to refresh WordPress Customizer panel upon entering a value
- Set Featured Image for Archive templates
- Multiple image logo for theme
- Hide Twenty Eleven Theme From Themes Page
- How do I change Twenty Nineteen’s primary color without using the color slider in the theme customizer?
- How to add the main style.css to my index.php?
- Remove action within a class in a parent theme from the child theme
- How to tell a theme to use different .mo and .po files?
- Can I apply a WP theme to a specific custom page template?
- How to move WordPress theme files into a subfolder without breaking the theme?
- remove rel=next on home page but not others
- Is it possible to use child theme of child them?
- Disable Sidebar in the Product Page in Storefront Theme [closed]
- How i can get widgets areas working in customizer?
- Renaming the Twenty Fourteen WordPress theme
- Defining different theme for Blog posts page
- Force theme or disallow theme change
- What are the things that will be affected in case there is some wordpress updates or theme updates?
- Create more than one section in Theme Customizer
- Color palet in the WordPress’ front-end?
- Get name of current page template in Gutenberg era
- Should I implement my own custom theme
- How can I manually activate my previous theme without browser access to dashboard?
- Advantages of wordpress theme vs wordpress as a backend only [closed]
- Theme, WordPress Version, MySQL Version, PHP Version Update affected files and folders
- Can “Classic Editor” plugin help to replicate the old website / theme development experience from c. 2011?
- Creating custom meta box throws PHP warning error in WordPress
- What is the point of needing add_theme_support( ‘html5’) in WordPress 5.x
- Plugin and themes are adding the same stylesheets
- How to display footer menus in wordpress
- WordPress EduPress and businessbite Theme Installation Failed [closed]
- Debugging in WordPress at Theme installation [duplicate]
- understanding theme hierarchy
- Posts as filtered list – expandable
- How to remove current theme customizations
- Create QuickStart Package for WordPress just like in Joomla
- Jquery Theme Roller to WordPress
- Implementation of language_attributes function
- How to automate setup of theme, pages, widgets, etc for a new site in multi-site?
- is theme network enabled?
- my blog crashes ie7?
- Setting Multiple Post Containers Across Homepage And Costumize Them
- wordpress-theme 2017: featured image behaviour: where to set the height of the featured image?
- How to disable a widget area of a specific page?
- Trying to create a child theme with plugin
- Own Theme custom CSS does not display in editor but works in page
- Remove Read More Buttons
- CSS/JS is not working in multi lang installation
- Error while downloading WordPress themes
- wordpress theme link url
- Theme stops media uploader from working
- Work on theme files on a server & browser preview before installing it
- Route to custom file
- div having different appearances in different themes
- Satoshi WordPress Theme – Portfolio SetUp Issues
- wordpress template page Usage [duplicate]
- How to make a website like the ones in theme demos? [closed]
- theme 2016 – customize css – nothing happens
- Can’t upload the theme
- Divi theme including javascript
- Best Practice Jumbotron Image for WordPress ~ Responsive
- How to make a page extend full screen [closed]
- Should you directly edit Template Parts and Templates from themes?
- Remove ALL HTML from single page
- Remove Google Fonts from parent theme within a child theme [closed]
- get_post_meta() doesn’t allow email