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 have jquery file like as follows

"portfolio.css"
"jquery-ui-1.8.18.custom.css"
"portfolio.js"

I want to include these files into my plugin... if anyone have solution for how to include above mentioned file into wordpress plugin then tell me....

please.... thank you in advance

share|improve this question
    
Where will these files be used? Front end or backend? –  Rutwick Gangurde Jun 20 '12 at 6:03

1 Answer 1

You should use this snippet inside your function:

wp_register_style('mycss', WP_PLUGIN_URL . '/whatever.css');
wp_enqueue_style('mycss');

Then you add this add_action after your function, to call your the CSS in the :

add_action ( 'wp_head', 'your_function_name');

For javascript, use wp_register_script() and wp_enqueue_script() instead.

WordPress function reference: wp_enqueue_style and wp_enqueue_script

share|improve this answer
1  
Wrong way bro... This is now deprecated, should be done using the wp_enqueue_script action hook. –  Rutwick Gangurde Jun 20 '12 at 6:04

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.