I am struggling with this problem: I'm currently trying to implement a color picker for my theme admin page (specifically, I am using this one: http://bgrins.github.io/spectrum/ ).
Loading the color picker in the front is very easy: I'm just referencing the js file:
<script type="text/javascript" src="wp-content/themes/mytheme/js/spectrum.js"></script>
pasting the script:
<script>
$(".basic").spectrum({
color: "#f00",
change: function(color) {
$("#basic-log").text("change called: " + color.toHexString());
}
});
</script>
and then, obviously, adding the color picker field where I need it:
<input type='text' class="basic"/>
It's working perfectly. However, if I try to do the same in my functions.php file, to have it displayed in my backend, it doesn't work at all.
Ps. Before trying out this color picker, I tried to use the WordPress Iris (the default one included in every wp installation), by following this tutorial (http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/ ), to no avail.
I also installed a plugin that supposedly was a demo showing how to implement the default color picker ( https://github.com/rachelbaker/iris-color-picker-demo ). It didn't work either.
Any help would be immensely appreciated, I feel like I'm missing something but I can't understand what...