Customizer live preview not working, refreshes but nothing change

Well, by some experiments, I found the answer. get_theme_mod won’t get you the real-time value when called in ‘after_setup_theme’ or ‘init’, it does work in ‘customize_preview_init’ and ‘wp_loaded’, so the working code: add_action(‘customize_preview_init’, ‘my_header’ ); function my_header() { if(get_theme_mod(‘enable_vertical_header’)) { $vertical_header = new Vertical_Header; } }

get_theme_mod always returns default

In the Customizer code you need to do following change to work. You dont need ta_pluton_social_link[facebook] like array in Control. Check following example and modify accordingly to other fields also. $wp_customize->add_control(‘facebook’, array( ‘label’ => __(‘Facebook URL’, ‘ta_pluton’), ‘section’ => ‘ta_pluton_social_links’, ‘settings’ => ‘ta_pluton_social_link[facebook]’, )); To fetch URL you can use get_theme_mod. Check example below. Following … Read more

if has theme mod

try this code: if( get_theme_mod(‘your_setting_name’) ){ //your code }else{ //your code } Note: get_theme_mod() return false if no value exist for your setting

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