If your settings are stored as Theme Mods, rather than as a Settings API option, then you need to pass the appropriate value to the type
parameter to $wp_customize->add_setting()
:
'option'
: Settings API option (get_option()
)'theme_mod'
: Theme Mods API option (get_theme_mod()
)
Try changing this:
$wp_customize->add_setting( $this_theme . '_theme_options['. $setting .']', array(
'default' => $param['default'],
'sanitize_callback' => 'sanitize_hex_color',
'type' => 'option',
'capability' => 'edit_theme_options',
'priority' => $i
) );
…to this:
$wp_customize->add_setting( $this_theme . '_theme_options['. $setting .']', array(
'default' => $param['default'],
'sanitize_callback' => 'sanitize_hex_color',
// CHANGE ME HERE
'type' => 'theme_mod',
'capability' => 'edit_theme_options',
'priority' => $i
) );
Related Posts:
- Theme Customizer – How to create a sub panel
- Should a child theme share the same theme options row as the parent, or should it have it’s own options row?
- Alignment Problem [closed]
- WordPress activate theme error $pagenow
- Switching among theme customizations
- WordPress Customazation API section in section
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Opinions and recommendations on the best barebones base theme [closed]
- How to move the sidebar in TwentyFifteen to the right?
- Override parent theme translation on child theme
- Link to specific Customizer section
- Starter Theme vs Parent Theme? Pros and cons
- How to set thumbnail image for a (child) theme
- Do Child-Themes automatically load the Translation from the Parent-Theme?
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- Best practices for a Style/CSS based theme options page?
- How to use media upload on theme option page?
- Add a dropdown to theme customizer
- How to refresh WordPress Customizer panel upon entering a value
- Difference between stylesheet_directory and template_directory
- How to override the “inc” folder (or any folder) in a theme using child theme?
- Looking for a way to load a function after customizer preview refresh complete
- Add a page outside of the current theme?
- Jquery in Child Theme
- Removing Shortcodes from Child Theme
- Display custom_background outside wp_head()
- How do I change Twenty Nineteen’s primary color without using the color slider in the theme customizer?
- Edit theme wp_head
- Which settings/options are saved on a theme-basis and how does this affect theme-switching?
- Are custom inner theme folders in any way overridable by child themes?
- How to avoid loading style.css twice in child-theme?
- How do I get a parent theme modification from a child theme?
- Remove action within a class in a parent theme from the child theme
- Getting rid of unused css directives [closed]
- Register theme customizer settings when theme activates [duplicate]
- Switch Theme Through Options Panel
- Override parent theme translation on child theme
- How to make alert for new version on theme options?
- Child-theme breaks site
- How to mark an option as selected
- get_header(‘header2’) not working properly in child themes
- Is it possible to use child theme of child them?
- Change logo on each page of University Hub theme [closed]
- How to change the themes “Live Preview” url within the Appearance->Themes page?
- How do I copy my Parent Templates to my Child Templates?
- How can I show more than 15 themes at a time in the admin menu?
- How to go about pre generating css file with variables from theme options
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- Can’t Install Child Theme “The parent theme is missing. Please install the “Default” parent theme.”
- Does uninstalling a WordPress theme delete its database values?
- Cannot find the code for “Edit This” link in posts in a specific theme
- Can I rename a theme’s folder and still receive updates?
- Child theme not visible
- Overwriting templates in child theme and performance
- Defining different theme for Blog posts page
- Themes—Child Themes
- How to set different settings for a mobile theme?
- How to load parent theme style.css?
- Child theme not using parent theme css/styles/formatting?
- Child Style.css not overriding parent theme style located in assets/css/main.css
- Disable Theme API / Front end (for API only environment)
- Does theme update also update a child theme zip
- What’s the proper way to include inlined javascript-source?
- What is the major difference between child theme and normal theme
- How to understand a specific bit of WordPress syntax
- How does a Child Theme works?
- Creating new templates in child themes breaks layout
- Creating a theme options page
- How to create child theme of already active and customized theme
- Inject widgets from one sidebar into another with PHP
- Where all are child themes recorded when they are created in WordPress
- I have some doubts regarding how to implement child theme
- get_option in header.php not returning value from customizer
- How to conditionally display widgetized areas in theme customizer?
- Internal error 500 accessing Theme > Customize
- How do I get rid of or change the footer in my child theme?
- Create more than one section in Theme Customizer
- How Do I Use A Custom Mobile Theme?
- How can I make some themes usable only by admins?
- Custom options below pages/posts editor?
- How do you approach block structured content?
- How to change only one javascript function in wordpress child theme?
- Mobile issue – website isn’t properly detecting screen size [closed]
- Edited Child Theme’s “header.php” but it doesn’t appear to change the file
- Updating my free theme delete all my changes [closed]
- Own Theme Customizer displays error message when saving, saving still works
- Switching to a child theme
- Child Theme not overriding a template section on live site – but is on local site
- Getting 503 on various files
- Redux callback action
- Port existing Bootstrap site to WordPress?
- Do not show one specific widget on one specific page
- How to enqueue javascript for WP Customize options sidebar?
- How can we hide the parent’s theme url at the child themes details on a multisite?
- Is it possible to create child themes using the WordPress Dashboard?
- Preserve theme settings when migrating from local to live
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- Functions containing parameter ‘yourtheme’
- What is the “pub” theme? [closed]