WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating new plugin so i need add a java script file and css file.

These are my javascript files

  1. jquery.min.js
  2. jquery-1.3.2.min.js
  3. jquery.tabify.js

Css file:

  1. newstyle.css
share|improve this question
why do you include jQuery twice? – rlemon Apr 9 '12 at 21:31
check this answer stackoverflow.com/a/38050537/1153703 – Bikesh M Annur Jun 27 at 9:43
up vote 3 down vote accepted

WordPress already ships with jQuery. There is no need to include it in your theme.


Let's say your jquery.tabify.js file is located in /js/jquery.tabify.js in your theme. Include the following code in your functions.php file:

function jquery_tabify() {
        get_template_directory_uri() . '/js/jquery.tabify.js',
        array( 'jquery' )
add_action( 'wp_enqueue_scripts', 'jquery_tabify' );

This will include your script and jQuery. jQuery is marked as a dependency, so it's loaded first.

If your file is instead hosted on a separate server, let's say as http://site.com/jquery.tabify.js, specify that as the path instead (omitting get_template_directory_uri()):

function jquery_tabify() {
        array( 'jquery' )
add_action( 'wp_enqueue_scripts', 'jquery_tabify' );


You register styles the same way. Assuming your file is located in /css/newstyle.css, add the following code to your functions.php file:

function add_newstyle_stylesheet() {
        get_template_directory_uri() . '/css/newstyle.css'
    wp_enqueue_style( 'newstyle' );
add_action( 'wp_enqueue_scripts', 'add_newstyle_stylesheet' );
share|improve this answer
ok.thank you so much. – SANS780730 Apr 9 '12 at 22:31

Your Answer


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.