Kirki: generate toggles for each taxonomy term

You can use a Kirki helper class for this (pass your taxonomy into Kirki_Helper::get_terms), but you need to register after the taxonomies are registered, otherwise you get an error: function my_theme_add_categories_customizer_control() { Kirki::add_field(‘my_config’, array( ‘type’ => ‘multicheck’, ‘settings’ => ‘show_months’, ‘label’ => esc_attr__(‘My Control’, ‘my_textdomain’), ‘section’ => ‘months’, ‘priority’ => 10, ‘choices’ => Kirki_Helper::get_terms(array(‘months’)) )); … Read more

Amend description of menu location in customizer WordPress

You need to be modifying a section not a setting. Try this: add_action( ‘customize_register’, function( $wp_customize ) { $section = $wp_customize->get_section( ‘menu_locations’ ); $section->description .= “<p>Custom HTML added.</p>”; }, 12 ); The priority of 12 is used because \WP_Customize_Nav_Menus::customize_register() happens at priority 11, and this is where the section is added.

Detect device change (desktop, tablet or mobile) in Customizer

Yes, the way to accomplish this would be to send messages from the Customizer controls pane window to the Customizer preview window when the wp.customize.previewedDevice value changes. So you can enqueue a script at the customize_controls_enqueue_scripts action with customize-controls as its script dependency that does: (function ( api ) { api.bind( ‘ready’, function() { function … Read more

Adding a new setting using Kirki or WP customizer with an if statement

get_theme_mod in that context will only work after you save and refresh. In order to hide a control based on the value of another control you can use the active_callback argument in the 2nd control like this: Spotlight_Kirki::add_field( ‘spotlight_config’, array( ‘type’ => ‘radio’, ‘settings’ => ‘spotlight_layout_type’, ‘label’ => esc_html__( ‘Layout Type’ , ‘spotlight’ ), ‘section’ … Read more

WordPress Customizer allow line break

The only way I was able to make it work was that: functions.php function test_customizer( $wp_customize ) { $wp_customize->add_setting( ‘themeslug_text_setting_id’, array( ‘capability’ => ‘edit_theme_options’, ‘default’ => ‘Lorem Ipsum’, ‘sanitize_callback’ => ‘sanitize_textarea_field’, ) ); $wp_customize->add_control( ‘themeslug_text_setting_id’, array( ‘type’ => ‘text’, ‘section’ => ‘title_tagline’, // Add a default or your own section ‘label’ => __( ‘Custom Text’ … Read more

Child Theme Customizer not working

I realize that I did not know that you needed an extra step for the functions.php. Here is the last step I needed. <?php function my_theme_enqueue_styles() { $parent_style=”parent-style”; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( $parent_style ), wp_get_theme()->get(‘Version’) ); } add_action( … Read more

Add Links to Customizer

You need to start by adding the register action and then add section, setting and control. Be sure the change the $my_theme to your theme’s slug so this options only show up on your theme. class SampleAddonCustomizer { public $my_theme=”enter-your-theme-slug-here”; // <- Enter your theme slug here public function hooks() { $current_theme = wp_get_theme(); if( … Read more

Theme Customize API Panel Concept

Fields always go in sections. Sections go in panels. $wp_customize->add_panel( ‘newsletter_panel’, array( ‘title’ => __( ‘Newsletter’, ‘twentytwelve’ ), ‘priority’ => 41, ) ); $wp_customize->add_section( ‘newsletter’, array( ‘title’ => __( ‘Newsletter’, ‘twentytwelve’ ), ‘priority’ => 41, ‘panel’ => ‘newsletter_panel’ ) ); That will put a “Newsletter” section inside a “Newsletter” panel. All the fields should still … Read more

Customizer: How to change Header Image description

The description param unfortunately is not used in this control. You can see that the message is hard-coded in the control’s template. That should be changed in core, but in the mean time, you can enqueue some JS at the customize_controls_enqueue_scripts action with the dependency of customize-controls which does this: wp.customize.control( ‘header_image’, function( control ) … Read more

Add Customize posts edit links to selectively refreshed partials [closed]

Customize Posts recognizes post field partials as defined by selectors in WP_Customize_Posts_Preview::get_post_field_partial_schema() combined by looking for the closest .hentry or .post-{id} elements. So as long as the posts in your editors-picks partials make use of the post_class() function for each element’s container and the other microformats like .entry-title for the child elements, then the post … Read more

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