You’ll want to enqueue the script in your functions.php (If this is in a plugin, you could do a little differently). Here’s a sample:
function owl_scripts()
{
wp_enqueue_script( 'owl-carousel', get_stylesheet_directory_uri() . 'js/carousel.js', array( 'jquery' ), '', true );
wp_enqueue_style( 'owl-style-min', get_stylesheet_directory_uri() . 'css/carousel.css' );
}
add_action( 'wp_enqueue_scripts', 'owl_scripts' );
This is assuming:
- You’re using a child theme.
- You put the carousel.js in the directory ‘your-child-theme/js’.
- You put the carousel.css in the directory ‘your-child-theme/css’.
Related Posts:
- Meta_query compare operator explanation
- Exclude post ID from wp_query
- Get array of posts from the current archive page loop
- Custom query incorrectly returning everything [closed]
- Last post ordered by publish date using WP_Query on front page
- Query certain amount of posts from multiple dates
- Meta Query with date and time on the same Day before given time
- In loop: posts have thumbnail AND other variables
- Orderby = none not working [duplicate]
- Add inline HTML to posts published within last 24hrs
- Add and in the header while looping over custom query in page template
- Single page theme
- Pagination not working on static page
- WordPress pagination link always leads to home page
- Query posts with more than 20 comments
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- Including only current user’s posts in search
- Implementing an OR statement to wordpress wp_query
- How can i simulate “taxonomy__in” in query?
- How do I reset this wp_list_categories query?
- Refine search results using WP_Query
- query_posts: how to show all ‘meta_value’ containing a specific word?
- How to show subcategories using loop?
- Minimize database queries to user tables?
- Pagination of a WP_Query Loop in a child-page page template
- Add condition of user capability in WP_query
- add_filter() depending on search term
- Get all products which have both product category
- How to make Meta Query case sensitive?
- Populate tax_query terms parameter with post term
- Orderby the sum of several numeric custom meta fields
- Fastest way of counting posts of a custom post type in a specific taxonomy term?
- wp_query ‘s’, search filter with pagination is not working
- Why is wp_query causing an uncaught error to is_user_logged_in() not defined?
- Modify wp-query and sort by post meta key
- Check if loop has any categories?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- How to display an other custom post type in a different custom post type’s archive?
- Replacing raw database query to WP_Query
- get_post_meta in WP_Query
- How to alter local query, not main query [duplicate]
- WP CLI can’t delete plugin related table
- Inserting HTML to close and open divs in WP_Query loops
- WP_Query results stored in variables
- Change query from cat id to slug or name?
- Query only the posts with a post format of “audio”
- Display Current Post’s Position in Custom Taxonomy
- Using Wp_Query without the loop?
- infinite loop in wp_query using simple query
- Custom WP_Query id
- wp query for popular post with simple field
- Parent and child categories
- Set post number to single posts
- Orderby custom meta returns random order
- get_post() is not returning correct value
- How does WP generate the default $query in WP_Query based on the URL?
- Intiger meta value with ‘>=’ returns posts with lower value
- Update query for wp_posts and wp_postmeta
- How to print term name inside wp post loop
- Grabbing taxonomy terms and inserting them into an array
- custom page with post content using read more
- WP_Query with page_ids in arguments without a result
- how to put thumbnail below category’s title?
- Woocommerce Shortcode which displays a table with product data
- JOIN filter doesn’t work in WP_Query in wp-ajax calls
- Why is my pagination /page/2 taking me to index.php?
- Creating a query that get all posts but places meta items first
- get_posts query is taking about 40 seconds to execute
- Customize the Sorting Dropdown in WooCommerce use another list or more page
- How to wp_query every Sunday between a startdate and enddate?
- meta_query – check for multiple meta values in key which holds an array of values
- How do I stop the same post showing multiple times in a archive?
- Searching for a specific month in a metadata saved as Timestamp (Wp_Query)
- Order Element By Custom Field in WordPress
- Display All Top Child Categories / Taxonomy
- how to get custom attachment url?
- WP_Query on custom key and value
- Set “editor” role to existing user
- how to get wp_query posts only first letter of alphabet A?
- How to break up output of posts for different terms on same page?
- How to mix two orderby-parameters into one ordered result
- Custom Post Type WP_Query with filters and search
- Get posts by similar names and categories
- Query by meta value (add a dropdown of all values)
- Calculating efficiently on large amount of data generated by wp_query
- WP Query issue for multiple values
- Calling a function with WP_Query only ever brings the first result
- How To Query All Attachment Images Found In Post Galleries
- WordPress meta_query not working
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Filter WP_Query output before it is accessed (pre_get_posts)?
- $wp_query when new WP_Query
- Divide WP_Query posts by date & post type
- Unable to pass variable
- New WordPress WP Query using posts from certain categories
- Edit WordPress loop, taxonomies, & filter
- WP query based on two meta queries
- WordPress website links redirect to homepage
- How to display posts from a specific term first then another posts from another terms using tax_query
- Display only posts with thumbnails