You have to register the sidebars in the parent theme just late later enough. Use a hook that runs later, and child themes can register their theme support.
Child theme
add_action( 'after_setup_theme', 'register_header_sidebar_support' );
function register_header_sidebar_support()
{
return add_theme_support( 'header-sidebar' );
}
Parent theme
add_action( 'wp_loaded', 'register_theme_sidebars' );
function register_theme_sidebars()
{
if ( current_theme_supports( 'header-sidebar' ) )
register_sidebar(
array (
'name' => __( 'Header', 'parent_theme_textdomain' )
)
);
}
Related Posts:
- How to add CSS class to custom logo?
- Editing the custom background CSS
- How to add default images for custom backgrounds?
- Add colors to existing color palette without replacing it
- What flex-width/height does?
- add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
- “add_theme_support” for custom footer color?
- Show video as part of the post?
- How to add theme support?
- Edit footer via customizer
- Theme Development: Starter Content after hook
- Can I add multiple arrays within add_theme_support( ‘colors’ )?
- How to use add_theme_support(‘html5’)?
- Theme support title tag – how to replace the default WP separator (with a filter)?
- WordPress HTML5 Gallery Support – Convert HTML4 -> HTML5
- add_theme_support( ‘admin-bar’ ) causes fatal error
- What is difference between add_theme_support and Theme Customization API?
- Replaceing _custom_background_cb
- Theme’s featured image option is not showing up
- What is the difference between wp_register_sidebar_widget and register_widget?
- How to enqueue script if widget is displayed on page?
- Custom Image section in Customizer
- Form Submitting Error with get_template_part()
- Get 10 posts from a WP_Query. If less than 10, get the remainder from elsewhere
- get_stylesheet_directory() returns wrong URI… localhost/using vhosts
- How Do I Programmatically Force Custom Permalinks with My Theme?
- wp_get_attachment_image_attributes not working for me
- Best practice (forward compatibility) for theme options
- How to use Plupload in themes
- what’s meaning of it when submit a theme?
- Translated strings not appearing – what am I missing?
- Feature Survey – What would you want in a resume theme?
- Can I upload WordPress-react theme in Wp theme repository
- the_excerpt() not showing manual excerpt for Pages
- How should I store global information such as a phone number so that it is editable through the CMS?
- What are the Theme tags in style.css used for?
- WordPress nav_menu_css_class theme filter is not being called
- How do I locally enqeue the mediaelement.js file into a wordpress theme
- Cannot get full thumbnail size using the_post_thumbnail
- Is it safe to enqueue a font style without putting http or https?
- Version control for both Vagrant config and themes being developed [closed]
- Is there a way to activate different theme for specified users? [closed]
- wp_editor() usage in custom meta box
- current_user_can Not Always Working Properly
- Does a premium / for sale theme need to go through the WordPress approval process?
- filter out “uncategorized” from all category listings with one filter in functions.php?
- Can’t select my block by clicking on it
- Is it possible to use Twitter intents with the post’s image in WordPress?
- How to add a user defined hyperlink to the “Featured Image” and the_post_thumbnail()
- Using PIE CSS in WordPress. “localizing” styles
- Category specific themes?
- Missing tested up to on readme text validator
- Change locale by detecting viewer’s browser language setting and let them choose prefered language after
- Why is it needed to enqueue parent stylesheet in child theme?
- Posting page on all subdomains
- WordPress Unite Theme: Footer isn’t sticking [closed]
- How to set a correct $content_width when there are two content widths on one page?
- Limit number of users a role can create
- How to enqueue javascript for WP Customize options sidebar?
- Do not display post images on front page
- Customize how a WordPress theme looks like in the Theme Selector
- Change WordPress header color using customizer
- Default Text not showing from customizer
- Images not showing after path specified in header.php
- How to set wp_options in functions.php for removeing the Default Front Page
- Template for landing pages
- How to show a manageable list of images on a post?
- Remove link on full-size images
- How to reset post data properly
- Theme options save routine clashes with plugin save
- Customizer Color Control Not Working
- get_search_query() not working with search queries with ampersand in it
- where to start with WordPress theme development [closed]
- Create a Grid/List Toggle in WordPress Archive
- If user is logged in and has a role echo statement
- Fixed button and slideshow in template upload per page
- Non-standard (new) theme file
- Best Practice for Server Processing
- WordPress Show Single Post on Home Page with previous/ Next Button
- Is there any way to store single.php wordpress file into a php variable
- How to change listing type permlink?
- Menu is in Reversed order
- How to connect two child themes on different sub domains to the same base theme
- Group several custom global page templates in sub-folder
- Should I detect the device or the page first?
- Get chronological page order
- Query wp_postmeta into an array based on post_id
- Theme not uploading showing maximum upload size on live site
- Best way to access variables in template markup
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- Problem with multiple menus in theme
- How to convert that page to a wordpress template? [closed]
- JQuery Equal Height in Rows Conflicts Only Works without Registering wp_footer();
- Saving Permalinks Results in 403 MAMP (Windows)
- Add rel to all images in a post
- WordPress theme Modifications not showing up on live server
- Incorrect sidebar showing on WooCommerce Store page [closed]
- customize functionality of share buttons under each blog post [closed]
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- WordPress Two Level Filters on Getting Custom Taxonomy Terms