Create custom control for WordPress customizer using JavaScript

After adding your custom control class, you need to register your control like below code, then you can call your control via JS function prefix_customize_register( $wp_customize ) { $wp_customize->register_control_type( ‘TestControl’ ); } add_action( ‘customize_register’, ‘prefix_customize_register’ ); Then via JS, like this: api.control.add( new api.Control( ‘birthdate’, { type: ‘test-control’, label: ‘Birthdate’, description: “Someone was born on … Read more

adding checkbox to theme customizer

I was able to solve this. Here is the code that got the checkbox working. function theme_customizer_register_checkbox($wp_customize) { $wp_customize->add_section( ‘global_options’, array( ‘title’ => ‘Global Options’, ) ); $wp_customize->add_setting( ‘show_supporters’, array( ‘default’ => true, ‘transport’ => ‘postMessage’ ) ); $wp_customize->add_control( ‘show_supporters’, array( ‘section’ => ‘global_options’, ‘label’ => ‘Show supporters section?’, ‘type’ => ‘checkbox’ ) ); } … Read more

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