Send data from Customizer Settings to Customizer Preview with settingless control
Send data from Customizer Settings to Customizer Preview with settingless control
Send data from Customizer Settings to Customizer Preview with settingless control
Theme Customizer – My panel disappears
Because an email isn’t a URL; you need to prepend the protocol to the value you pass to esc_url: <a href=”https://wordpress.stackexchange.com/questions/227925/<?php echo esc_url(“mailto:’ . get_theme_mod( ‘header_utility_right_email_block_link’ ) ) ?>” …
I needed to tweak the settings and controls code a bit to get them to work: $wp_customize->add_panel(‘mypanel’, array( ‘title’ => __(‘My awesome panel’, ‘domain’), ‘description’ => __(“This is the description which doesn’t want to show up :(“, ‘domain’), ‘capability’ => ‘edit_theme_options’, ‘priority’ => 2 )); $wp_customize->add_section(‘mysection’, array( ‘title’ => __(‘My even more awesome section’, ‘domain’), … Read more
You can change active status of section using customize_section_active filter. It gives 2 parameters $active–bool and $section–object. Haven’t tried it so you can try and see if works for you. Located in \wp-includes\class-wp-customize-section.php, for your research. As second option you can try altering capability for the section. Note: I’m just giving options, and have not … Read more
The problem is in the sanitize_callback = ‘absint’. WP_Customize_Image_Control doesn’t save attachment id so you can’t use absint, If you want to store the ID of the image’s attachment then use WP_Customize_Media_Control, there is also a referance about this here
The ‘type’=>’option’ parameter is not required for the colour picker, instead use: $wp_customize->add_setting(‘text_color’, array( ‘default’ => ‘#fff’, ‘sanitize_callback’ => ‘sanitize_hex_color’, ));
Here’s some code I use which places a control in the Title’s and Taglines section to add a logo image.. $wp_customize->add_setting( ‘theme_logo’ ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,’theme_logo’,array( ‘label’ => ‘Logo’, ‘section’ => ‘title_tagline’, ‘settings’ => ‘theme_logo’, ‘priority’ => 1 ) ) ); I then call it in header.php with this bit.. <?php if( get_theme_mod( ‘theme_logo’ … Read more
Yes, you can definitely make the customizer load a specific page. You can also set a return page. You can do this with the query strings url & return. You need to pass encoded urls for these to work. So instead of loading http://yoursite.com/wp-admin/customize.php you will want to load http://yoursite.com/wp-admin/customize.php?url=http%3A%2F%2Flocalhost%3A8888%2F%3Fpage_id%3D2 In my example the customizer … Read more
Figured it out. Use “get_panel” not “get_section” $wp_customize->get_panel(‘widgets’)->title = __( ‘Sidebar & Footer widgets’ );