How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?

I suggest you take a look at the Kirki toolkit: https://github.com/aristath/kirki It has a “repeater” field that should do what you need. It’s still under heavy development and for the time being I’ve only added the ability to use a few field-types with it, so I guess it depends on what exactly the data you … Read more

customiser settings for checkbox (displaying content)

Looks like you are missing some things from the settings array, namely type need to be theme_mod here and capability should be set too. You can try: $wp_customize->add_setting( ‘woocommerce_productdisplay’ , array( ‘type’ => ‘theme_mod’, ‘capability’ => ‘edit_theme_options’, ‘default’ => ‘1’, ‘transport’ => ‘refresh’, ‘sanitize_callback’ => ”, ) ); Also note default for a checkbox should … Read more

How to use WP Theme Option: Custom_Backgrounds on specific element?

If your theme uses in-built custom-background callback then you can overwrite add_theme_support in your child theme. Yo do not need to use remove_theme_support. First add custom-background support with your callback function. $defaults_args = array( ‘wp-head-callback’ => ‘my_custom_background_cb’, ); add_theme_support( ‘custom-background’, $defaults_args ); In callback function specify div CSS class or ID function my_custom_background_cb() { $bg_image … Read more

WP Customizer: Save a control state

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’), … Read more

Customizer Values Not Saving in Custom Theme

This live preview code should be like this – wp.customize(‘inspection_cta_text’, function(value){ value.bind( function(to) { $(‘.footer-cta’).text(to); }); }); Basically you don’t need the “em”. And there always should be default value present in the theme mod. For example – .footer { border-top: solid 1px #<?php echo get_theme_mod( ‘background_color’, ‘#fff’ ); ?>; } In your case it … Read more

WP 4.5 hide core customizer sections

If you check out the source of WP_Customizer, you’ll see there is no title_tagline or header_image at the time the filter runs: final class WP_Customize_Manager { protected $components = array( ‘widgets’, ‘nav_menus’ ); public function __construct() { // a bunch of requires $components = apply_filters( ‘customize_loaded_components’, $this->components, $this ); } } Use the customize_register hook … Read more

Output values from Customizer isn’t working

You’re registering the option in the customizer as an option and then trying to get it as a theme_mod. If you simply change the type from option to theme_mod when you’re registering the setting it’s gonna work fine. So try using this code: add_action(‘customize_register’, ‘h2c_customize_register’); function h2c_customize_register($wp_customize) { $wp_customize->add_setting( ‘logo_width_px’, array ( ‘default’ => ”, … Read more

How to delete old custom-css-stuff in the customizer-live-preview?

<style> tag accepts all the global HTML attribute, including class and id. So, you could do something like this: wp.customize( ‘custom_css’, function( value ) { value.bind( function( newval ) { if ( $(“#my-custom-style”).length > 0 ) { $(“#my-custom-style”).remove(); } $(‘head’).append(“<style id=”my-custom-style”>”+ newval + “</style>”); } ); } );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)