Way to check if we are in Theme Customizer mode? [duplicate]
As in this question: How to execute conditional script when on new customize.php (Theme Customize) screen global $wp_customize; if ( isset( $wp_customize ) ) { // do stuff }
As in this question: How to execute conditional script when on new customize.php (Theme Customize) screen global $wp_customize; if ( isset( $wp_customize ) ) { // do stuff }
Yes, that is possible. Take a look at the codex and you will see that you can pass arguments with add_theme_support( ‘custom-background’). One of them is the callback function that generates the <style> tags: _custom_background_cb. You can pass your own function as an argument to add_theme_support. Here is the code of the original function (retrieved … Read more
Widgets DO appear in the Customizer, but only if you are on the page that they are used on. For example, I have a sidebar for the Archive page. When I’m in the Customizer and on the homepage, that sidebar doesn’t appear. But if I navigate to an archive page while in the Customizer, it … Read more
As overcomplicated as it sounds, I always find the best way to handle admin menu modifications is to overlook the given wordpress remove_ functions and go straight to the $menu and $submenu globals. In the case you’ve specified here, you’d want to change your code to: add_action(‘admin_menu’, ‘remove_unnecessary_wordpress_menus’, 999); function remove_unnecessary_wordpress_menus(){ global $submenu; unset($submenu[‘themes.php’][20]); unset($submenu[‘themes.php’][22]); … Read more
It’s probably best to render the shortcode on output by running it through do_shortcode()
Try using the existing WordPress function to modify color palette like: function my_mce4_options( $init ) { $default_colours=” “000000”, “Black”, “993300”, “Burnt orange”, “333300”, “Dark olive”, “003300”, “Dark green”, “003366”, “Dark azure”, “000080”, “Navy Blue”, “333399”, “Indigo”, “333333”, “Very dark gray”, “800000”, “Maroon”, “FF6600”, “Orange”, “808000”, “Olive”, “008000”, “Green”, “008080”, “Teal”, “0000FF”, “Blue”, “666699”, “Grayish blue”, … Read more
I don’t know where your iframe is getting it’s color information from, but you probably need to write the selected color from the color picker to that field. This is an example including throttle. update_color is a function that deals with the new color. You can put there some code that puts the picked color … Read more
High level description of what I ended doing, it is actually not too bad to do such an implementation and save you the effort of having different code for the widget and customizer forms, but there are many small details to take care of. Store settings as a meta values for the post Create proper … Read more
If you want to bind the callback from the customizer panel you can use: wp.customizer.bind( ‘preview-ready’, callbackFn ); otherwise if you need to bind it from preview itself you can use: wp.customize.previewer.bind(‘ready’, callbackFn);
It’s an interesting thought to use the theme customizer to completely build the front page. Here is how I would start it. First, let’s build a section that only shows on the front-page: add_action( ‘customize_register’, ‘wpse_205445_customizer’ ); function wpse_205445_customizer($wp_customize) { $wp_customize->add_section( ‘custom-front-page’, array( ‘title’ => “Custom Front Page”, ‘priority’ => 10, ‘active_callback’ => ‘is_front_page’ )); … Read more