3.5 colorpicker from a child theme
-
I am trying to add the 3.5 colorpicker to a child theme.
I created a metabox that shows when editing a page or post (not from a theme/plugin options). The colorpicker button shows, the style is loaded but when you click on the colorpicker button nothing happens.
I can remove the display: none and the colorpicker shows but there is no functionality.
In the child themes functions.php file I have this:
function wp_enqueue_color_picker($hook_suffix) { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker-script', get_bloginfo('stylesheet_directory').'/include/javascript/custom-scripts.js', array( 'wp-color-picker' ), false, true ); } add_action( 'admin_enqueue_scripts', 'wp_enqueue_color_picker' );
The function loads this script:
jQuery(document).ready(function($){ $('.color-picker').wpColorPicker(); });
Here is the html:
<input type="text" value="#cc9999" class="color-picker" data-default-color="#009999" />
It seems like the javascript part is not working.
- The topic ‘3.5 colorpicker from a child theme’ is closed to new replies.