Your function seems fine and it’s probably hooked on init
:
add_action('init','blankslate_widgets_init')
function blankslate_widgets_init() {
//code
}
But in your theme you probably want to add some checking :
<?php if (is_active_sidebar('left-sidebar')) dynamic_sidebar('left-sidebar'); ?>
I would use left-sidebar
instead left_sidebar
as sidebar ID perhaps.
Related Posts:
- remove_action on after_setup_theme not working from child theme
- How to load scripts/styles specific for a page
- Is there any global functions.php file which works for any theme?
- Child theme – Overriding ‘require_once’ in functions.php
- Display random categories on the front page (Finding and Editing Theme Functions)
- Issue with get_theme_mod returning a blank value instead of the saved value
- Hourly Routine Not Firing ( wp_schedule_event() )
- How to create a widgetized sidebar for every category dynamically?
- which is the function that removes accented vowels?
- Check if has any sidebar active on current page
- Theme Demo in live Site
- Dynamically Register Sidebars For Each Top Level Page
- Customising widget titles/headings in WP 5.8
- Change a sidebar name?
- add sidebar area to header of child theme
- Child Theme Not Overriding Parent Theme
- Advice: Template structure – php blocks in sidebar or someting else?
- Where does function_exists() look to decide whether a function exists? [closed]
- Theme-Config tab in admin Pannel?
- Make “sidebar template” the default template for new pages
- Missing argument 2 for a custom function widgets_init
- Is It wrong to use oop approach on functions.php?
- PHP files included in functions.php don’t seem to work
- How to remove howdy dropdown menu content
- is_dynamic_sidebar always returns true while using Jetpack visibility
- Hook specific functions if on a specific admin page
- How can I change the do_action function in footer (copyright area)
- How to insert custom widget in custom sidebar in theme activation?
- functions.php mistakenly deleted
- Echo tags used to describe the theme
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- changing behaviour of get_search_form
- Child Theme files – what is needed?
- How to load jQuery in the footer – nothing works for me
- Problem only while using require_once() within functions.php
- Translation of theme using child theme
- Display post shortcode content in the sidebar?
- How to stop twenty fifteen theme from cropping featured images?
- Theme functions.php file auto delete everyday [closed]
- Best practices regarding the creation of custom widgets?
- How to remove style attribute in WordPress RSS output?
- WordPress website Rs changed to currency symbol
- Is there an alternative to get_template_directory_uri()?
- create filter in functions.php
- Add Custom Background Properties to Customizer
- Functions in custom theme
- Parse error after modifying the template menu [closed]
- WordPress PHP Conflicting User Sessions
- How do you Permanently Delete Sidebars
- Function that outputs second theme url
- Custom Sidebar only on single post
- Is `is_sidebar_active()` deprecated, and showing error?
- register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead
- Not all CSS elements transferring via parent to child?
- unnecessary request call for js and css after calling wp_dequeue_script
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Turn get_posts as string into an array for use in theme admin options
- Filter nav menu items HTML tags and wrap inner text with span
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Why is it so hard to add a class to the tag in the sidebar widget?
- Getting the teaser text without overriding global variables
- Default Nav Highlight
- Best way to disable sidebars on posts (only)?
- Register_Sidebar overwriting itself and doesn’t exist in global $wp_registered_sidebars;
- “options.php” not found
- How to override this theme function in child theme
- get_template_directory() – references parent theme directory
- New checkbox in custom widget isn’t saving data
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- How do I preserve changes to a theme’s functions.php across updates?
- Multiple, Dynamic, Sidebars Problem – First Sidebar not working properly
- What function actually renders the wp_admin_bar ? How can I call it?
- Astra theme – cannot set short product description under the product title (product name)
- Header menu aligned right on all pages except for single-post page [closed]
- Class parameter in get_avatar args doesn’t get added to output
- How do you insert code into the sidebar?
- CSS style and app.js not loading
- Setting Up Child Theme To Take Priority
- Shortcode Initialization in a Custom Theme
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Trying to Add a LEFT Sidebar?
- Getting back a blank WordPress site following functions code edit
- us states dropdown function and echo in theme template files
- How to pass a variable from a template page to the child theme functions.php
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- Random text changing to weird icons in both admin & front end
- Register a widget area when a theme option has been saved?
- unregister_sidebar in child theme not working
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- Add the title of a widget as an ID – for anchor links
- Add custom css to theme
- Which template file to edit to edit homepage in Mystile [closed]
- Adding function to function.php error 505 [closed]
- How to get postId from the argument $block when register_block_type()?
- My website is generating weired url parameters of paginated pages
- How to automatically load Google Fonts on pages only as they’re used?
- adding custom classes for tables
- Scripts not appending to element in AJAX call – why?