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
- A way to automatically install pages on theme install?
- Why doesn’t default WordPress page view use force_balance_tags?
- Proper, exhaustive documentation for wp.editor etc
- Create “File-less” Page Template in Functions.php
- How to determine if custom menu is active?
- Including CSS and JS on Admin Screen of Custom Theme Options
- How to remove duplicate link from add_menu_page
- Automatic Updates For Private And Commercial Themes?
- add_image_size is scaling, even though crop is set to true
- Adding inline styles from a widget
- Get password when user registers and save it sha1 into database
- Merging PHP download script into `functions.php`
- Should use widgets in this case?
- Changing the entire control choices using wp.customize with JavaScript
- Static Front Page problem
- Get last modified date for menu link
- A theme that follows all the best practices to learn from?
- get_post() function returns post even if it is trashed
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Can wordpress run in root of existing php site with no theme on index.php but all other WP posts/pages?
- How to regenerate thumbnails when they’re stored on S3
- CSS won’t style output of wp_nav_menu() correctly
- after_setup_theme, Global Variable and Theme Customizer
- How to make WP admin recognize a newly created child theme?
- Can’t show custom post thumbnail sizes as background images
- Theme translation not applying
- How to add filter the post thumbnail before save in database?
- Custom theme development additional pages
- How to add material design css in wordpress and woocommerce
- How to set the currently active page in the menu including parents
- changing blog title to an image using filter function in child theme
- WordPress taxonomy and archive custom class
- Add attachment for all images in post
- [&hellip appearing instead of […]
- Is it possible to include an HTML flat-file website inside a WordPress theme?
- Static home page with “Blog” inside?
- How to have content scroll over background
- Need help with adding templates (archives and sitemap) to WordPress child theme
- save_post action doesn’t passing post id to my function as argument
- How can I change the theme of different posts using a plugin?
- Exclude custom post type from search conflict with get_posts
- How to obfuscate theme directory URLs
- Remove specific published page when theme deactivated
- Is there Photo Categories?
- Post and page content not displaying in search results
- WordPress does not load page template or anything else, just empty page with header and footer
- add shortcode support in customizer
- How to make my themes compatible with different WordPress versions?
- Templates dropdown not appearing using _s theme (underscores)
- get_header action not working
- Some doubts about WordPress handle the horizontal main menu visualization
- How To Display Value from Theme Options Field in Front End Template?
- Changing footer depending on URL (poli language site)
- Update Specific Key Value in Complex `wp_options` object
- Custom search template is showing 404 when adding query string
- How do I restructure the comment HTML layout?
- How to set a custom URL for the iframe in the customize page
- Cart displayed above header
- Post Featured Image Custom Sizing?
- Theme: dropdown hover menu not showing up in IE/Edge
- How to Show Next, Previous, and Page Numbers with wp_link_pages
- how to ensure responsiveness in wp themes? [closed]
- PHP Script on a template page & dealing with URI’s
- home is not working in wordpreess
- Let user publish posts on community page
- Responsive Images with art direction
- How to perform str_replace on the results of wp_list_pages
- Activating theme in local MAMP installation results in HTTP ERROR 500
- How would I get this to work – send to post from thick box
- Safe way to echo wp_trim_words
- How can I demonstrate themes well?
- Support Multiple featured images
- How to using custom DB tables
- Programatically add a page in WordPress
- How to highlight current menu bar base on the URL?
- How to remove proudly created by WordPress in theme?
- How to load custom php file in WordPress themes
- Roll my own theme or customize an existing one [closed]
- Add wrapper for a specific sub-menu
- Not Able to Access Terms Under Custom Taxonomy Archive
- Custom add to cart does not work well only on the first time