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]
- Override parent theme translation on child theme
- How to set thumbnail image for a (child) theme
- Best practices for a Style/CSS based theme options page?
- How to use media upload on theme option page?
- How to refresh WordPress Customizer panel upon entering a value
- 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?
- How to avoid loading style.css twice in child-theme?
- How do I get a parent theme modification from a child theme?
- Register theme customizer settings when theme activates [duplicate]
- How to make alert for new version on theme options?
- Child-theme breaks site
- 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 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?
- Does uninstalling a WordPress theme delete its database values?
- Cannot find the code for “Edit This” link in posts in a specific theme
- Overwriting templates in child theme and performance
- Themes—Child Themes
- How to set different settings for a mobile theme?
- 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)
- What’s the proper way to include inlined javascript-source?
- What is the major difference between child theme and normal theme
- 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
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- How Do I Use A Custom Mobile Theme?
- Custom options below pages/posts editor?
- How to change only one javascript function in wordpress child theme?
- Switching to a child theme
- Getting 503 on various files
- Port existing Bootstrap site to WordPress?
- How to enqueue javascript for WP Customize options sidebar?
- Is it possible to create child themes using the WordPress Dashboard?
- Preserve theme settings when migrating from local to live
- Functions containing parameter ‘yourtheme’
- What is the “pub” theme? [closed]
- Can I create a child theme from a premium theme without losing my posts and page etc that I already have?
- Enqueue custom css file on specific page
- How do I remove ‘Active Theme’ section from Customizer?
- Passing dynamic options from backend to frontend
- Creating a child-theme: CSS not loading
- simplified explanation on child themes?
- Issue with theme mod options during domain migration
- Why submenu item’s background color is not changing by css?
- How to add custom JS file in WordPress Child theme with get_theme_file_uri
- .PO file is found but I don’t see translations: how to debug the problem?
- Child theme looks different from parent theme, and incorrectly displays parts
- Where did my Theme Editor go?
- WordPress Theme Breaking on Migration to Live Site [closed]
- Cannot update a file for my theme
- List of categories instead of dropdown menu selector in admin options
- wordpress-theme 2017: featured image behaviour: where to set the height of the featured image?
- How do I bring a page template into a new theme with separate styling?
- Minor changes on theme per subdomain – same contents
- WordPress customizer extremely slow, cant work in it
- Custom homepage with recent blog posts
- Where to find child themes?
- Dynamic image for Jumbotron on WordPress Custom Theme
- Why does WordPress Editor Only Use Half the Box?
- Issues with dynamic widget in theme customizer
- how to create a section inside a section with theme options customizer
- How to customize the colors within a stylesheet using a WordPress setting
- WP Customize API Checkbox change value
- Strange Theme Error – parent style occasionally showing though child theme
- Using Customizer value in an external PHP file inside a theme
- How do you make your theme Child Theme-able? [duplicate]
- Create /archive page in WordPress Theme
- How to create a second index.php?
- Child theme after CSS modification
- Overwrite template-tags.php in child theme
- Church hope them issue
- Page structure using The Customizer Api
- WordPress Theme redirects to the Index page – Theme customizer problem
- Divi theme including javascript
- how to add dynamic footer credit in Greatmag theme [closed]
- Obtaining the original unchanged Theme [closed]
- Why does twentysixteen take a free hand in dealing with longstanding usability principles? [closed]
- Remove Google Fonts from parent theme within a child theme [closed]
- Check if style is declared in child theme from within parent theme. if so, use that style in parent theme
- Issue with customizer and widget page