Found a solution. Turns out the activate, deactivate functions are not persistent, meaning the controls’ state are reset if the page is refreshed!
Therefore I used 'active_callback' => 'fname'
in my customizer.php in order to make changes persistent where fname is the function name as seen below.
function fname() {
if ( !strcmp ( get_theme_mod('above-header'), 'no') == 0 ) {
return true;
}
else {
return false;
}
}
Related Posts:
- Color Picker (iris) in widget – refresh when edited in Customizer
- Access Customizer’s DOM – jQuery
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- $wp_customize customizer_preview_init not firing inside javascript
- Hide/show customizer controls based on other settings in Customizer
- trigger(‘change’) not working
- Using jQuery to retrieve customizer value
- WordPress customizer refresh screen after save
- Sorting widget control
- WP Customizer compare and set a value via javascript
- Callback After WordPress Customizer Complete Loading
- How to call custom jQuery plugins into the customizer controls
- Javascript when Customizer preview is ready/refreshed?
- Remove button from page if viewed through Customizer
- Customizer add query to preview URL
- Retrieve customizer value using ajax or customizer api and print the value in theme
- How to add input file plain text and submit to publish?
- How to set time delay in javascript
- Disable button in jQuery
- Adding placeholder attribute using Jquery
- JavaScript: filter() for Objects
- wait() or sleep() function in jquery?
- Ajax Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- Enable & Disable a Div and its elements in Javascript
- Which selector do I need to select an option by its text?
- Check if inputs are empty using jQuery
- The ‘describe’ keyword in javascript
- CSS not pulling in for jQuery UI dialog
- WordPress Ajax URL for function in functions.php
- Move WordPress native javascript to bottom of page?
- Check if jquery library exist
- Loading style.css and Jquery using HTTPS
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- Is it worth updating WP admin to jQuery 1.5?
- Proper way to load a single post via Ajax?
- Ajax not firing properly using Firefox, but works in Chrome
- Get ACF value in external jQuery document
- Adding jQuery dependency prevents my script from enqueuing/loading
- How to pass jQuery ajax URL value
- how to get the comment ID in the front end when the REPLY button is clicked?
- Gravity Forms not loading under https, jQuery is not defined
- Change header image loaded by jQuery to use HTTPS
- Admin wp_ajax hook returning 0
- Automatic jQuery accordion from header tags
- Add a Fancybox automatically to post type “post” images
- How to deregister a jquery version for a specific page?
- Enqueuing javascript files
- How to undo deregister script and use local versions?
- Can’t load a class into WordPress post editor’s content field
- Hide metabox dependant on page template chosen
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- Frontend Post with JQuery AJAX to Php Issue
- show/hide div with simple jQuery script [closed]
- Searching multiple tags and adding jQuery dependant script onto page template?
- TinyMCE 4 remove/add attributes for all images
- wp_dequeue_script not working in my plugin
- Trouble adding inline style after jQuery in the footer!
- Reload wordpress shortcodes
- jQuery script isn’t posting to database
- $.browser Undefined Seemingly Causing Faulty Page Display
- I’m trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it’s not working
- Invoking Jquery in a Plugin
- Why not working jquery show() function in wordpress? [closed]
- Loading scripts on a single page plants the script in the footer
- registering new jQuery after wp_deregister_script() not working
- Displaying an image’s alt title and caption inside a fancybox window. Working, but showing the same alt and caption for each image
- jQuery Show DIV and Remove Button [closed]
- timeouts (ERR_CONNECTION_RESET) on seemingly random files after upgrading to HTTPS
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Need workaround for insecure XMLHttpRequest endpoint request
- jQuery don’t working
- Change zurb foundation top bar style on.scroll in wordpress theme using jquery and css
- how to use wp_editor() here am getting empty result
- jQuery is not defined, working on local server but not online
- WP_ENQUEUE not working with Foundation 5
- Save jQuery UI Sortable on WordPress
- Problem adding MP3 attachments to a jPlayer playlist
- problems with jquery external rss feed integration
- wp_enqueue_script jquery and jquery ui not working
- Axis guidelines over an image
- $ not defined using jQuery in WordPress
- WordPress forbidden 403 on delete in production vs local environment
- jquery Autocomplete
- Get ajaxForm response value
- Update a parent theme JQuery property in the child theme
- jQuery search function not running in WordPress but running locally (fiddle)
- Refresh widget admin page resetting jQuery hidden class
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Can’t seem to get JQuery working (wordpress plugin)
- Ajax Request with jQuery not happening
- Console shows ReferenceError: jQuery is not defined, no clue why!
- Sorting UL Listing Within the TinyMCE Visual Editor in WordPress
- jQuery .change() Event Bubbling in WP Admin
- My .js file is getting a 404
- Combo box populating a DIV using ajax/jquery
- how to display post in jquery slider and carousel
- Carousel Hover Image
- What is calling jquery?
- Fire an event after Featured Image selection
- Elementor form – checkboxes validation