How to create a theme customizer ‘sub’ panel?

You create Panels, and put Sections inside those Panels. So if you have your panel: $wp_customize->add_panel( ‘panel_id’, array( ‘priority’ => 10, ‘capability’ => ‘edit_theme_options’, ‘theme_supports’ => ”, ‘title’ => __(‘Theme Options’, ‘mytheme’), ‘description’ => __(‘Several settings pertaining my theme’, ‘mytheme’), ) ); Then you need to add your sections: $wp_customize->add_section( ‘header_settings’, array( ‘priority’ => 10, … Read more

Is it Possible to Extend WP Customize JS Methods?

I will enhance my small comment on your question. But again the hint; I’m not a JS expert. The follow source, hints was only used on playing with the Customizer for different checks, examples, like my sandbox. wp.customize Understanding the WP theme customizer interface centers around understanding the wp.customize javascript object. The wp.customize object is … Read more

Custom Image section in Customizer

So I did some research on the matter and I found a solution. Basically WordPress has this cool feature where you can call something called get_theme_mod so what I essentially did was add get_theme_mod inside my <img> src. So this is what I changed my <img> tag to after finding out about get_theme_mod: <img src=”https://wordpress.stackexchange.com/questions/215701/<?php … Read more

How do I implement selective refresh with a customizer setting?

Create a function to output the selectively refreshed template code (I wrapped the HTML within <div class=”cta-wrap”> to make it easier to target this particular block of markup.) function wpse247234_cta_block() { if ( ( get_theme_mod( ‘intro_page’ ) ) != ” ) { $intro_id = get_theme_mod( ‘intro_page’ ); $intro_header = get_the_title( $intro_id ); $intro_excerpt = get_the_excerpt( … Read more

Customizer JS API

1) Maybe bind to the api.ready state which may fix having to call your section twice (function($, api){ api.bind( ‘ready’, function() {… } })(jQuery); I saw a note in trac that said “Note that the APIs for dynamically-added controls, and APIs for JS-templated custom Sections and Panels are not yet available as of WordPress 4.2. … Read more

Add settings to menu items in the Customizer

You’re running up against an incomplete implementation of modifying nav menus in the Customizer. In particular, inside of the phpdoc for WP_Customize_Nav_Menu_Item_Setting::preview() you can see this comment: // @todo Add get_post_metadata filters for plugins to add their data. Nevertheless, even though we didn’t implemented core support for previewing changes to nav menu item postmeta, it … Read more

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