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, https://developer.wordpress.org/reference/functions/do_shortcode/ 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(

Please show me how to use an if/else statement in combination with wp_enqueue

I think something like the following should work. Uncomment the var_dump to double check you’re getting the saved theme mod value you’re expecting. If not, check the naming of your customizer setting and that it saved properly. function mytheme_styles() { $theme_dir_uri = get_template_directory_uri(); // enqueue common styles and scripts // wp_enqueue_style( $handle, $src = false, … Read more

Extending WP_Customize_Media_Control to return filename

I have noticed that WP_Customize_Image_Control does indeed return the filename instead of the ID, but this is only for images. That’s because the class extends WP_Customize_Upload_Control which has the type set to upload: class WP_Customize_Upload_Control extends WP_Customize_Media_Control { public $type=”upload”; public $mime_type=””; … } And for Customizer controllers using the above class, the JavaScript controller … Read more

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