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
- Tips for using WordPress as a CMS? [closed]
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- Registering Class methods as hook callbacks
- Edit plugin without hooks in functions.php
- How can I log a user out of WordPress before the page loads?
- Adding a widget programmatically
- Disable author pages for specific users
- Set active theme via URL
- Seeking clarification on page request life-cycle
- Is dynamic forms/entries possible in Widget?
- How to Get Admin Settings for a widget when using the_widget() with custom widget
- Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint
- WordPress multiple widget in single plugin
- Setting up widgets in wordpress with a unique ID for the after_title argument
- How to find out what blocks are added by a plugin
- Translating plugin inside the theme [closed]
- Admin Dashboard with Custom Tab for Client
- How to prevent users to download videos from lms website?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Different UI in WordPress
- Do widget options need to be escaped widget()?
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Homemade plugin while using Themify Ultra
- Theme/Plugin installation through url on button click
- How can I position ShareThis buttons manually when using the plug-in? [closed]
- Does WP delete deprecated plugin/theme files on plugin/theme upgrade?
- How to use get_template part in the plugin?
- How can I use get header from within my plugin?
- How to add Wrapper Div/container element around WordPress Widget Content
- My single.php page does not show the related data to the post which is clicked
- How to activate a plugin on the activation of a theme?
- WordPress plugin won’t show on some themes
- Turning on output buffering in a wordpress plugin
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Short messages widget [closed]
- How to make a dynamic css class whose name changes every visit to confuse scraper
- How do I add a plugin dependency to my customized theme?
- wp_trash_post hook – problem with page updating if using wp_die
- Add action to custom Function
- Cannot add edit themes and add plugins after multisite update
- Remove updates text on plugin or themes list page
- Widget where it can make changes to the container
- Widget content turns up before title
- wp_footer hook running twice
- Plugin Hook When New Author Added
- How to prevent plugin, theme installation failures on WordPress?
- Fail on admin_enqueue_scripts when I try it to upload a CSS file to my WordPress Plugin
- Alternative Hook to the_content for Changing Background Color
- Unpublished Pages Failing To Appear On Custom Path
- Remove a div class with condition
- How Can I Increase Breadcrumb Position Count (Starting From 2)?
- Main content of site not showing, but does show when logged in to wp-admin
- Hide WordPress Site URL from Source Code
- Plugin function in child theme
- Edit plugin’s HTML output with Hooks
- Unable to activate themes on localhost
- Shortcode generated widget to appear on same line as heading text and button
- How do I keep children of certain parent menus expanded by default on a sidebar?
- {status}_{post_type} does not run correctly?
- Identify if the_post hook is being called from the admin post list
- why my wordpress dont have toolbar like, plugin, themes and other?
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- How to link file or image from wordpress plugin dir to theme by using themes function.php, is it possible?
- Passing a parameter to filter and action functions
- WordPress hook source
- How to `remove_action` from plugin
- Creating themes using the one Plugin (Toolkit)
- functions.php conditional output for a single plugin
- OOP Plugin: Where should I place the action hooks in the class?
- Site is setup statically – how to make it content managable?
- How to develop an extension for a simple form post and post back? [closed]
- How to add homepage Widget?
- What can I do to customize a widget provided with this plugin? from where have I to start?
- Javascript as Jquery Function Call?
- Content expands beyond its column container [closed]
- How to escape html code?
- Elementor with system colors instead of kit colors [closed]
- Can’t use updated variables in handle function
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)