WP Customizer compare and set a value via javascript

You’re binding changes to themeb_scheme via an anonymous callback function with the parameter value as the new setting of themeb_scheme. This should work: wp.customize( ‘themeb_scheme’, ‘themeb_footerbg’, function( themeb_scheme, themeb_footerbg ) { themeb_scheme.bind( function( value ) { if( value == ‘light’){ themeb_footerbg.set( ‘#eaeaea’ ); } else if( value == ‘dark’){ themeb_footerbg.set( ‘#323232’ ); } else { … Read more

Is there any way to register custom background images like header images?

Here is code for it! As explained by Progostech $defaults = array( ‘default-color’ => ”, ‘default-image’ => ”, ‘default-repeat’ => ‘repeat’, ‘default-position-x’ => ‘left’, ‘default-position-y’ => ‘top’, ‘default-size’ => ‘auto’, ‘default-attachment’ => ‘scroll’, ‘wp-head-callback’ => ‘_custom_background_cb’, ‘admin-head-callback’ => ”, ‘admin-preview-callback’ => ” ); add_theme_support( ‘custom-background’, $defaults );

Place a message in theme customizer sidebar

To do what you ask there are two solutions that would be optimal. Solution #1 The simplest way would would be to use the WordPress customizer’s notification API – as this API was specifically designed to add messages to the customizer in a location that users can expect to see notifications from their theme, uniformly. … Read more

How to add “get_theme_mod” inside a shortcode?

I would comment, but lack the pointage… You seem to be on the right track: I see that your shortcode callback and the function are named differently: (f_gallery_shortcode / function_gallery_shortcode). Try this: add_shortcode( ‘ui_gallery’,’function_gallery_shortcode’ ); function function_gallery_shortcode(){ $dynamic_h1 = “<h1>” . get_theme_mod(‘dynamich1’) . “</h1>”; return $dynamic_h1; } now using [ui_gallery] in your posts, should return … Read more

How to check if a Customizer setting is set?

Adding an action will fire the function regardless, but you can add an if statement to see if the value has been set. This way the tag will not fire if the value is not set function chrome_theme_meta() { $chrome_theme = get_theme_mod( ‘chrome_theme’, ” ); if(!empty($chrome_theme){//test to see if a value is set echo ‘<meta … Read more

modify menu item links dynamically

Can be changed using filter add_filter(‘wp_get_nav_menu_items’, ‘add_utm_to_links’, 10, 3); function add_utm_to_links($items, $menu, $args) { foreach($items as $item) { if(!empty($item->url)) { $item->url .= strchr($url, ‘?’) === false ? ‘?’ : ‘&’; $item->url .= ‘utm=value’; } } return $items; }

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