I work with owl carousel 2 for carousel content.
JS:
$(\'#owl-demo\').owlCarousel({
loop: true,
margin: 10,
nav: true,
items: 1,
});
You could check the number of .item elements before you call your plugin like so:
// Be more specific with your selector if .items is used elsewhere on the page.
var items = $('.items');
if(items.length > 1) {
$('#owl-demo').owlCarousel({
loop: true,
...
});
} else {
// same as above but with loop: false;
}