How to hook CSS file according to theme selection in the customizer section

I have added a new area in the Customizer section which allows a user to choose whichever theme colors they want: But I don’t know how to activate/add CSS files according to the selection. i.e. add green.css if green theme color is selected or add blue.css if blue theme color is selected. 1 Answer 1 … Read more

Can the Theme Customizer be used to generate static/cachable CSS, and how?

I am currently trying to make a customizable Bootstrap theme for my personal WordPress site, however, I am running into some issues. Bootstrap can be customized by modifying the SCSS variables, and I am trying to bring that customization into the Theme Customizer by utilizing Leafo’s scssphp to recompile Bootstrap on the fly during the … Read more

wordpress custom theme import and export options for sample data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question I am Created WordPress custom theme as per Html template. it was worked fine. now … Read more

How to extend nav-menu-item-control data in Appearance > Customize?

I have one question as for Nav Menu Items custom fields in the Appearance > Customizer screen. Since 5.4. there are 2 new hooks: wp_nav_menu_item_custom_fields – it works for Appearance > Menus properly and I have added 2 custom fields. wp_nav_menu_item_custom_fields_customize_template – it works for Appearance > Customizer and adds HTML properly. But I need … Read more

Theme Customizer changes are dissappearing when change page

An example option i am using: // Layout $wp_customize->add_setting( $themeslug.’_settings[layout]’, array( ‘default’ => ‘content-sidebar’, ‘type’ => ‘option’, ‘transport’ => ‘postMessage’ ) ); $wp_customize->add_control( $themeslug.’_settings[layout]’, array( ‘label’ => __( ‘Layout’, ‘anatema’ ), ‘section’ => ‘secenek’, ‘type’ => ‘radio’, ‘choices’ => array( ‘content-sidebar’ => __( ‘Content – Sidebar’, ‘anatema’ ), ‘sidebar-content’ => __( ‘Sidebar – Content’, ‘anatema’ … Read more

Crop image from get_theme_mod Customizer field

I’m using the following code to allow a user to upload a custom image (in addition to header image) through the customizer. Is there a way to crop the image when displaying it? $wp_customize->add_setting( ‘intro-img’, array ( ‘default’ => ‘http://example.com/image.png’, ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, ‘intro-img’, array( ‘label’ => ‘Intro Image’, ‘section’ => ‘section_one’, … Read more