You should look into having your sidebars utilize the remove action function.
Then you can remove a sidebar and replace it in a function any number of ways.
For instance (this examples using a conditional based on a page called some-page.
function change_sidebar_yay() {
if ( is_single('some-page') ) {
remove_action( 'old_sidebar', 'your_function' ); //this is sidebar you want removed
add_action('get_sidebar', 'my_get_sidebar', 11);
}
}
http://codex.wordpress.org/Function_Reference/remove_action
The old_sidebar
and your_function
is the name and the function name of the sidebar you want removed, you will have to look in your theme to find the actual values the theme author used ( usually in functions.php but not always).
Also if the theme is hardcoded or does not create sidebars using hooks/actions this will not work.
Related Posts:
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- How to enable edit button in the theme’s customize UI?
- Need to create a Theme demo site that features multiple themes
- disable active plugins for specific theme
- Themes VS Plugins [duplicate]
- add_action in functions.php, do_action in plugin?
- Deactivate Plugin on Theme Switch
- How do I find out what is in control over a certain part of a website?
- How to get menu location in wp_update_nav_menu hook
- How to display a widget on a page with no theme?
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- elementor development – custom widget like an inner section widget
- Hooking into the HTML header container
- How to disable a widget area of a specific page?
- Is it possible to disable a theme programmatically?
- Hook on widget context plugin to add custom context for widget
- wp_login_form() ignoring login_form action hook
- Template from scratch: Sidebars not showing widget
- Am having issues intergrating this api into my wordpress site, any help please?
- Issue with customizer and widget page
- How to display more than one instance for a widget?
- Admin Theme customization
- Custom random quote widget breaks when used in multiple sidebars
- WSOD after upgrading to 3.1
- How to get all of the activate_plugin action parameters?
- Do widget options need to be escaped widget()?
- Modifying the comments section through a plugin regardless of theme
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Map a custom id to wordpress post id
- Ajax contact form widget plugin data not insert in database
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Check for security updates
- Trigger Elementor Popup via code [closed]
- wp_get_post_terms is difference obj model than the one in rest api response
- How to add media field to WP_Widget form function?
- Calling plugin function inside custom plugin for onclick event
- (FES EDD) New vendor submission page is blank
- There is any way to remove post-format filter? [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- Is there any kind of theme on WordPress to sell my own movies?
- Create custom registration form for WordPress Multisite
- get current date + 90 days and checking every day
- Child Pages Short Code plug-in and hover capabilities?
- changes to widget settings not showing up in individual pages pages until they’re updated [closed]
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Classified ad website : which solutions to use? [closed]
- How to hide CSS by default and show on button press
- How to remove traces from widget during uninstallation
- Get Time Taken By Each Action Hook in WordPress
- Linux Permissions and Ownership for WordPress
- posts comments goes to trash
- WordPress site periodically goes down
- Masonry images not working
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- Advanced Custom Field DatePicker [closed]
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Best place for short bio,image and button [closed]
- Which widget to use for display category post with view more? [closed]
- All sites themes functions.php have been changed
- WordPress Widget Not Saving Data
- Homemade plugin while using Themify Ultra
- Calendar Plugins – Featured Widget [closed]
- In the archive widget, how do I sort in between two years?
- Widgets Scripts don’t load – but load when I reload the page
- WordPress plugin subscribe2 not looking the same as before migration
- Why namespaces are rarely used in WordPress plugins?
- What will happen if i deactivate my visual composer plug in? [closed]
- Finding the URL to be used to check if plugin is installed with a theme
- Wysiwyg editor errors
- How to make WordPress customizable for clients
- Theme/Plugin installation through url on button click
- Setup page on first login on multisite
- How can I inject options into an select tag inside the widget form?
- (Big issue) Blog is Getting Down Each day.. what should i do.?
- Custom wordpress Theme and Plugin repository
- do_action() hook into load-(page)
- Add content to footer – above wp_footer
- How to add wp visual editor in a custom widget?
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Howto check version of another plugin and then add a submenu page to it
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- password_reset hook is not working
- The Hook registration_errors was not called
- How can I position ShareThis buttons manually when using the plug-in? [closed]
- How to require users to login when not logged in
- WordPress Widget – Saving multidimensional arrays into $instance
- Custom plugin appears outside of the sidebar container
- Conditional tag in Widget Logic for checking if top level page or if subpage
- Hook into existing tinyMCE button
- Error when using plugin QuickCache with plugin Mobile Smart ? [closed]
- Char limit on custom blog-post form? [closed]
- Trying to create a table/list of my EventBrite course listings [closed]
- How do I use wp_editor() in widget form?
- How to reorder and display a feed to be chronological?
- Hide certain widgets from specific user roles in admin
- Does WP delete deprecated plugin/theme files on plugin/theme upgrade?
- How to get post ID with hooks publish_post, new_to_publish, etc