enter image description here

owl carousel enqueue script

function custom_owlcarousel() {

wp_enqueue_style('owlmin-css', get_stylesheet_directory_uri().'/owl/owl.carousel.min.css', 'all');

wp_enqueue_style('owldefault', get_stylesheet_directory_uri().'/owl/owl.theme.default.min.css', 'all');

wp_enqueue_script('carousel-js', get_stylesheet_directory_uri().'/owl/owl.carousel.js', array('jquery'), false, true); 

wp_enqueue_script('global', get_stylesheet_directory_uri().'/boot/custom.js', array('jquery'), NULL, true);

add_action( 'wp_enqueue_scripts', 'custom_owlcarousel' );

custom js script

margin: 0,
responsiveClass: true,
smartSpeed: 500,
dots: ($(".owl-carousel .item").length > 1) ? true: false,
loop:($(".owl-carousel .item").length > 1) ? true: false,
responsive: {
    0: {
        items: 1,
    500: {
        items: 1,
    768: {
        items: 1,

CPT Shortcode Loop

function custom_owl($para,$content){
$para = shortcode_atts ( array(
'' => '',), $para);

$loop=new WP_Query($args);
if($loop->have_posts()): ?>
     <section class="slider">
          <div class="main-slider">
              <?php while($loop->have_posts()):$loop->the_post();?>
                        <div class="item">
                            <?php the_post_thumbnail(); ?>
                            <div class="slider-content">
                                <div class="container">
                                    <div class="title">
                                        <h1><?php the_title();?></h1>


    echo'<p>No Content Found</p>';
$loop = null; 
return ob_get_clean();}
add_shortcode ('owl-slider','custom_owl');

Read more here: wordpress cpt multiple owl carousel not working properly…the slider contents are listing down…instead of scrolling


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: