Second instance displaying same categories doesn't work.
-
Help! I added a carousel to the home page of our site to display posts from a single category. This works flawlessly. I copied the same shortcode to a different page, and it didn’t display any posts until I changed the “categories” attribute to a different category ID.
When the plugin doesn’t display any posts, the following error appears in the Chrome Developer console:
Uncaught SyntaxError: Unexpected token <The error is thrown because the plugin generates the following html (Notice the erroneous paragraph element </p> within the javascript.):
<p><script type=”text/javascript”>
jQuery(document).ready(function(e) {
var wpPostsCarousel12197 = jQuery(“#wp-posts-carousel-12197”);
wpPostsCarousel12197.owlCarousel({
loop: true,
nav: true,
navSpeed: 800,
dots: false,
dotsSpeed: 800,
lazyLoad: false,
autoplay: true,
autoplayHoverPause: true,
autoplayTimeout: 7000,
autoplaySpeed: 800,
margin: 5,
stagePadding: 0,
freeDrag: false,
mouseDrag: true,
touchDrag: true,
slideBy: 1,
fallbackEasing: “linear”,
responsiveClass: true,
navText: [ “previous”, “next” ],
responsive:{
0:{
items: 1
},
600:{
items: 1,</p>
<p> },
1000:{
items: 1
}
},
autoHeight: false
});
wpPostsCarousel12197.on(“mousewheel”, “.owl-stage”, function(e) {
if (e.deltaY > 0) {
wpPostsCarousel12197.trigger(“next.owl”);
} else {
wpPostsCarousel12197.trigger(“prev.owl”);
}
e.preventDefault();
});
});
</script></div>
- The topic ‘Second instance displaying same categories doesn't work.’ is closed to new replies.