Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to use new Iris color picker on the front-end. I succeed in using it on back-end: while using it on theme options I just enqueued the color picker like this …

wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_style( 'wp-color-picker' );

… and hooked it to admin_enqueue_scripts. It worked.

However, I don't think the same process will work on the front-end by just hooking to wp_enqueue_scripts. Should I have to include the core file of new Iris color picker myself, or there is some way I can enqueue the color picker from front-end as I have done in my theme option code?

share|improve this question

1 Answer 1

you can copy js and css files into your plugin path or theme path, then register and load them with other handles.

share|improve this answer
    
Why re-invert the wheel? WordPress includes those scripts in core for a reason –  bungeshea Dec 25 '12 at 8:25
    
Yes, WordPress includes those scripts in core and I enqueued those file in my back-end and used in my theme option but while enqueueing it in front-end, it didn't work –  rabin shrestha Dec 25 '12 at 12:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.