Show/hide section in theme customizer based on selection from another section

In this example, estore_is_cart should return true only if ‘suspended’ === $wp_customize->get_setting( ‘twsa_show_schedule’ )->value(). Or in other words: $wp_customize->add_control( ‘twsa_show_suspend’, array( ‘description’ => ‘Reason for suspension’, ‘section’ => ‘twsa_show’, ‘type’ => ‘textarea’, ‘active_callback’ => function() use ( $wp_customize ) { return ‘suspended’ === $wp_customize->get_setting( ‘twsa_show_schedule’ )->value(); }, ));

Override theme style rule in Gutenberg

.entry-content a:hover is more specific than .wp-block-button__link:hover. According to the rules of specificity, the first selector contains 2 class selectors (.entry-content and :hover), and 1 type selector (a), for a specificity score of 0,0,2,1. The second selector, on the other hand, contains 2 class selectors (.wp-block-button__link and :hover), and no type selectors, for a score …

Read more

Woocommerce image sizes missing from Appearance › Customize but not declared by theme

WooCommerce itself registers support for the default themes. For Twenty Fifteen it registers the following: add_theme_support( ‘wc-product-gallery-zoom’ ); add_theme_support( ‘wc-product-gallery-lightbox’ ); add_theme_support( ‘wc-product-gallery-slider’ ); add_theme_support( ‘woocommerce’, array( ‘thumbnail_image_width’ => 200, ‘single_image_width’ => 350, ) ); This is why those settings are not in the Customiser. However, regardless of what theme support is registered, the gallery_thumbnail_image_width …

Read more

Shortcode don’t work in custom option field, any solution?

If you have a shortcode string saved, try echoing it with do_shortcode function, which turns shortcodes into content. $saved_shortcode = get_option( ‘my_customizer’, ‘copyright’ ); if ( $saved_shortcode && is_string( $saved_shortcode ) ) { echo do_shortcode( $saved_shortcode ); } More about the function on the developer handbook, EDIT Another option is just echo the year …

Read more

Customizer section gone after adding second

The problem is that you’ve got duplicate control IDs. In section 1 you have: $wp_customize->add_control(new WP_Customize_Color_Control( $wp_customize, “qs_spirit_co_section_2_text_color_control”, array( “label” => __(“Text Color”, “qs-spirit-co”), “section” => “qs_spirit_co_section_1”, “settings” => “qs_spirit_co_section_1_text_color”, “type” => “color”, ) )); Which has qs_spirit_co_section_2_text_color_control as the ID. And in section 2 you have: $wp_customize->add_control(new WP_Customize_Color_Control( $wp_customize, “qs_spirit_co_section_2_text_color_control”, array( “label” => __(“Text …

Read more

How to add Theme Customizer Color?

You’ve got duplicate control IDs: $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, ‘link_color’, array( And: $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, ‘link_color’, array( They’re both link_color, but they need unique IDs. Simplest option is to use the setting IDs: $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, ‘starter_new_setting_name’, array( And: $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, ‘starter_new_setting_name2’, array(