Changing the entire control choices using wp.customize with JavaScript

You’re close. You just need to replace changeTheChoices() with set() as this is a method on wp.customize.Setting. See the following which also refactors a bit: wp.customize( ‘setting_category’, ‘setting_font’, function( categorySetting, fontSetting ) { categorySetting.bind( function( category ) { var newChoices = {}; // get new data from JSON using ‘category’ and populate the ‘newChoices’ fontSetting.set( … Read more

Hard-coded Audio Player

I would recommend that you have your theme require the wordpress.org version of the wpaudioplayer plugin. There is a great article about having themes check for and require plugins. As is well-argued on this WPSE answer, it’s not a great idea to take code from a plugin and include it in your theme because you … Read more

Add inline css to theme

According to Codex, this function accepts 2 arguments: <?php wp_add_inline_style( $handle, $data ); ?> Take a look at this example: function my_inline_css() { wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘/css/custom_script.css’ ); $btn_color = esc_attr( get_theme_mod( ‘my-custom-color’ ) ); $custom_css = ” .btn-default{ background-color: {$btn_color}; }”; wp_add_inline_style( ‘custom-style’, $my_custom_css ); } add_action( ‘wp_enqueue_scripts’, ‘my_inline_css’ ); You should have … Read more

Select menu on browser resize

I think the plugin you mention is the one I wrote so if you’re looking for answer on how to do it take a look at the code. http://wordpress.org/extend/plugins/dropdown-menus/ Essentially all I did was create a custom menu walker class so I could output the menus created in the backend as a dropdown. If it … Read more