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

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

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>”); } ); } );

Get WordPress page Id inside customizer

I think you work about the ajax call. Inside the theme, in the right frame works all default WP functions inside the loop. But if you get the post inside the customizer you can use the ajax call and get the id from the URL. Source Example JavaScript add_action( ‘wp_ajax_fb_custom’, ‘fb_customizer_ajax’ ); function fb_customizer_ajax() { … Read more

How do you add a link in the description of one section of the customizer to another section in a different panel?

The relevant line that generates that link in wp-includes\class-wp-customize-nav-menus.php is $description .= ‘<p>’ . sprintf( __( ‘You can also place menus in <a href=”https://wordpress.stackexchange.com/questions/248853/%s”>widget areas</a> with the &#8220;Custom Menu&#8221; widget.’ ), “javascript:wp.customize.panel( ‘widgets’ ).focus();” ) . ‘</p>’; and the more relevant part of it javascript:wp.customize.panel( ‘widgets’ ).focus();” ) so it seems like the key for … Read more

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