How to refresh Theme Customizer after change color inside wpColorPicker?

Try using the existing WordPress function to modify color palette like: function my_mce4_options( $init ) { $default_colours=” “000000”, “Black”, “993300”, “Burnt orange”, “333300”, “Dark olive”, “003300”, “Dark green”, “003366”, “Dark azure”, “000080”, “Navy Blue”, “333399”, “Indigo”, “333333”, “Very dark gray”, “800000”, “Maroon”, “FF6600”, “Orange”, “808000”, “Olive”, “008000”, “Green”, “008080”, “Teal”, “0000FF”, “Blue”, “666699”, “Grayish blue”, … Read more

Color Picker (iris) in widget – refresh when edited in Customizer

I don’t know where your iframe is getting it’s color information from, but you probably need to write the selected color from the color picker to that field. This is an example including throttle. update_color is a function that deals with the new color. You can put there some code that puts the picked color … Read more

Custom editable content for front page from Theme Customizer

It’s an interesting thought to use the theme customizer to completely build the front page. Here is how I would start it. First, let’s build a section that only shows on the front-page: add_action( ‘customize_register’, ‘wpse_205445_customizer’ ); function wpse_205445_customizer($wp_customize) { $wp_customize->add_section( ‘custom-front-page’, array( ‘title’ => “Custom Front Page”, ‘priority’ => 10, ‘active_callback’ => ‘is_front_page’ )); … Read more

How WP_Customize_Background_Image_Control is supposed to work?

There’s very little documentation on this class, but here below is the full example from WordPress core (here’s github). Note you’d be using the $wp_customize object you get as argument to your custom_register callback and not $this as does the core class. I’ve done a search and replace below and it works. /* CORE COPY … Read more

Is having multiple theme customizers for different pages possible?

This is not a complete solution and the code is not tested, but I it should be enough to give you a general idea of how to use the customizer for different pages. // Add “Edit page with customizer” link to relevant pages add_action(‘admin_bar_menu’, function($bar) { if (is_home()) { $bar->add_node(array( ‘id’ => ‘some-id-1’, ‘title’ => … Read more

How to Add Customizer Setting in Child Theme

OK, check out the theme developer handbook. $wp_customize->add_control( ‘reblog_number_control’, array( ‘label’ => __( ‘Number of Reblogs’, ‘tesseract-child’ ), ‘section’ => ‘tesseract_footer_options’, ‘settings’ => ‘number_of_reblogs’, ‘type’ => ‘text’, ‘priority’ => 10 ) ); Since you are in the child theme ‘title’ => __( ‘Reblog Options’, ‘tesseract’ ), shoudl be ‘title’ => __( ‘Reblog Options’, ‘tesseract-child’ ), … Read more

TinyMCE in customizer

SwAt.Be, your own answer helped me a bunch and I’ve nailed the problem of printing admin scripts after the last rendition of wp_editor. Also see how I pass JS setup function as tinymce option to sync the editor changes with WP customizer to make it work properly. if (class_exists(‘WP_Customize_Control’)) { class WP_Customize_Teeny_Control extends WP_Customize_Control { … Read more