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');
Related Posts:
- WordPress plugin archive
- Namespaces in WordPress – How do I initiate the main class?
- Plugin readme.txt and assets internationalization
- Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload
- post expire after x days
- MailChimp integration that allows users to select from multiple lists [closed]
- How to handle autoloading with composer by keeping the WordPress naming conventions?
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- filemtime() warning when enqueuing style within plugin
- Woocommerce – Display active variation product price [closed]
- Minimum PHP Required for WordPress
- Post query – show posts from specified day and month and whole years
- Support for simultaneous editing
- How to add social locker on custom fields
- tag breaks shortcode output (other solutions don’t work)
- Is this the right way to execute some PHP in my plugin after a button click on an options page?
- Show Sub pages excerpt+thumbnail
- Create entire wordpress as a github repositery?
- How to overwrite core/libraries/vendor template with child theme
- Plugin integrate in forum to show user profiles [closed]
- WordPress multi domain – redirect
- WP_Query and NULL meta keys
- background images WP Supersized on homepage
- Caching RSS plugin data
- Add simple Nivo Slider to wordpress site
- Submit custom form from post content and execute in plugin
- Limit the amount of words displayed by the Latest News plugin, or recommend an alternative [closed]
- How can i create page through plugin
- wordpress check wp_head and wp_footer
- Plugin to hide image in excerpt
- Is there a plugin that lets users request an account on the site? [closed]
- easy steps to make front end form without plugin
- Custom license for WordPress plugin
- Image change on hover
- Editing a text file from plugin menu
- Does using `add_action( ‘init’…` cause performance issues?
- How to connect rating to individual comments?
- Why is Google Search Console getting X-Robots-Tag noindex?
- Website show Google Ads when we have no Google Ads linked to our website
- How to create plugin/ page that reads from database
- Insert ads below the title
- Plugin not properly prepared for localization
- WordPress Active Plugins
- How to add filter for wordpress plugin?
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- WordPress meta-box and checkbox-list
- Two WooCommerce installations on the same server, one sends customer emails but the other does not
- Better WP Security plugin blocking calls using file_get_contents() method
- What plugins can I use to feature (affiliate) products on my blog (from Amazon.com)?
- Multiple Post Thumbnails Plugin – Need help with code
- WordPress Following? Social Users?
- Plugin privelages for “editors”
- Adding a jQuery modal dialog to the admin area
- Excluding specific post from custom next/previous theme function
- Update existing post dates to random dates and time
- Change language on website and change currency with url query
- How do I stop WordPress from recommending to install the following Plugin
- WordPress – estimate used product
- Revision featured image
- How can I send the mail once?
- Is it okay to make a plugin to the WordPress repo, but limit it’s actions to maximum N events?
- WordPress Dashboard add user password not working, etc
- I need to show side menu in wordpress
- Woocommerce product variation price: How to change price dynamically through hooks
- Add external javascript to post template
- AJAX update fails for public/non-admin users
- Check if plugin is active outside of admin screen
- WordPress Product Detail and catalog
- Translating Website
- I dont know why my localization is not working
- User upload fields
- Plugin does not not load code when not used (which is good) > Elementor
- WordPress DevOps – Environments (Rancher, Kubernetes, etc…)
- Why is every single HTML tag being stripped out of liveblog entries?
- How to add wordpress plugins in along with my standalone theme
- Create Database Tables on Plugin Activation hook
- Delivering Page Templates With Plugins
- Change page according to fetched GET Parameters
- Transition Post status not working
- Is there a way to add a custom input field for every taxonomy term in WP post editor?
- Where did the “WP-Custom” plugin go?
- How to change response of admin-ajax request?
- Plugin keeps saying needs to be updated and it’s in a constant loop [closed]
- wp plugin not working after website live
- Replace Dash (-) and Underscore ( _ ) with Space
- How can I add different menus (different style menu) on each page?
- Custom Table doesn’t create on plugin activation
- How to add plugin to blog [closed]
- how to display the page content in popup window?
- Code snippet plugin not working correctly with Windows live writer and WordPress
- Jquery based image accordian plugin
- Can’t modify plugin function
- WDTException: [0]: One or more columns doesn’t have a header
- How to Add Extra Text In WordPress Title Before Post Publish
- How can I make a quotation engine like this website in WooCommerce?
- Function not being called on form submit, only blank admin-post.php page
- WordPress Convert queries to slashes using function.php
- 404 Error on a WordPress Website, Error disappears for a while and again appears
- ShipStation WooCommerce Integration error
- Failed to update a post when I add a taxonomy to it