Installing Jplayer in WordPress

After uploading the plugin file to a directory inside your theme, you will want to enqueue the plugin file in functions.php

You should already have a similar function in your functions.php file, but if you don’t yo can add it. Change false to true if you want the file to load in the footer instead of the header. In this example I put the file inside a folder named ‘js’ inside my theme folder.

//Enqueue scripts
function register_scripts() {
      wp_enqueue_script('jplayer',get_template_directory_uri().'/js/jquery.jplayer.min.js',null,'1',false);

}

add_action('wp_enqueue_scripts','register_scripts');


//Enqueue styles
function register_styles() {

     //($handle, $src, $deps, $ver, $media)
    wp_enqueue_style('main_style',get_template_directory_uri().'/style.css?v=1',null,'0.1', $media="all");


}

add_action('wp_enqueue_scripts','register_styles');