How to use rgba color from theme customizer color picker

Why exactly you want to represent it in RGBA where A means alpha channel (I guess) I mean, hex does not support transparency, so if you want to convert it to RGB, you just need to convert from hex to decimal r = parseInt(hex.substring(0,2), 16); g = parseInt(hex.substring(2,4), 16); b = parseInt(hex.substring(4,6), 16); result=”rgba(“+r+’,’+g+’,’+b+’,’+1+’)’; taken … Read more

Using Theme Customizer Built-In Sections

The default controls are registered in WP_Customize_Manager::register_controls(), which is hooked to customize_register. This action is fired in another method, wp_loaded(), which is hooked to the action of the same name. To remove these default controls, use your own handler on customize_register with a later priority, so that it runs after register_controls() has added them: function … Read more

Theme Customizer – Choose where widget area appears, to let users organise widgets

You can move around sections in the customizer simply by accessing the datastructure and assign a different value to the panel. So supposing that your widget area, created in the usual way, is called wpse210938_area and you want to move it to the panel wpse210938_panel, you do this: add_action( ‘customize_register’, ‘wpse210938_move_widget_area’ ); function wpse210938_move_widget_area () … Read more

How to change the themes “Live Preview” url within the Appearance->Themes page?

External Live Previews For Themes The Live Preview buttons, on the /wp-admin/themes.php page, are generated from the tmpl-theme micro template: <script id=”tmpl-wpse” type=”text/template”> …cut… <div class=”theme-actions”> <# if ( data.active ) { #> <# if ( data.actions.customize ) { #> <a class=”button button-primary customize load-customize hide-if-no-customize” href=”https://wordpress.stackexchange.com/questions/220473/{{{ data.actions.customize }}}”><?php _e( ‘Customize’ ); ?></a> <# } … Read more

Does the customizer support multiple templates?

Yes, this is possible. Just add a callback to those mods that you want to appear on specific pages, like this: $wp_customize->add_control( ‘my_page_control’, array( … ‘active_callback’ => ‘is_page’, … )); You will see this control in the customizer only if you are viewing a page. Don’t forget to adapt the css produced by this mod … Read more

How to extend Customizer payload sent when ‘Save & Publish’ is triggered

You can monkeypatch the wp.customize.previewer.query method: add_action( ‘customize_controls_enqueue_scripts’, function () { wp_add_inline_script( ‘customize-controls’, ‘(function ( api ) { api.bind( “ready”, function () { var _query = api.previewer.query; api.previewer.query = function () { var query = _query.call( this ); query.foo = “bar”; return query; }; }); })( wp.customize );’ ); }); This will ensure the script … Read more