Custom Sanitation Function Triggering an Alert in Customizer?

Ok i solved it looks like that getimagesize will generate error/notice if image is not found, so alert box will fire… This is straight from PHP docs: If accessing the filename image is impossible getimagesize() will generate an error of level E_WARNING. On read error, getimagesize() will generate an error of level E_NOTICE. Here is … Read more

Customizer_register not saving custom setting to database

[*] The problem with the code sample is that the setting is using widget_ as the prefix. This is a reserved prefix for widgets, per the customizer handbook: Important: Do not use a setting ID that looks like widget_*, sidebars_widgets[*], nav_menu[*], or nav_menu_item[*]. These setting ID patterns are reserved for widget instances, sidebars, nav menus, … Read more

HTML inside Customizer

I’ve had a look inside of the theme you’ve mentioned that does this. It seems like the code below (inside the zerif_customizer.js) file is what is making this button. jQuery(‘.preview-notice’).append(‘<a class=”zerif-upgrade-to-pro-button” href=”http://themeisle.com/themes/zerif-pro-one-page-wordpress-theme/” class=”button” target=”_blank”>{pro}</a>’.replace(‘{pro}’,zerifLiteCustomizerObject.pro)); This can be found in the themes js file. They’ve then hooked this file onto the customizer in the functions.php file … Read more

Return value of get_background_color

To add custom background support in your theme you need to register the default custom background support. Example:- add_action(‘after_setup_theme’, function(){ add_theme_support( ‘custom-background’, array( ‘default-color’ => ‘black’ //Default color )); }); Now you will see a new section Background Image in customizer and in Color you will see a new option Background color Once you will … Read more

Return customizer setting value in functions.php

The solution was to get the customizer value inside the function, not passing the value to the function. function hn_add_inline_css() { $breakpoint = get_theme_mod( ‘setting_navigation-breakpoint’, ‘768’ ); $custom_css=” @media (min-width: ” . $breakpoint . ‘px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } …