0

i use jquery 1.11 and this code to ajax load wordpress post content in sidebar . everything is good but jquery functions of owl carousel not work and the carousel in post content not showing anything. ajaxify code to load post content:

jQuery(document).ready(function($){
$.ajaxSetup({cache:false});
$(".post-link").click(function(){
    var post_link = $(this).attr("href")+' #content';
    $("#single-post-container").html("loading ...");
    $("#single-post-container").load(post_link);
return false;
});

});

How can i use .ajaxcomplete() function to load owl carousel after ajax load post. best regards.

0

1 Answer 1

0

The reason you cannot use this by default is because of no conflict.

From the Codex:

The jQuery library included with WordPress is set to the noConflict() mode (see wp-includes/js/jquery/jquery.js). This is to prevent compatibility problems with other JavaScript libraries that WordPress can link.

In the noConflict() mode, the global $ shortcut for jQuery is not available, so you can still use:

jQuery(document).ready(function($){
    $.ajaxSetup({cache:false});
    ...
});

Read More in Codex

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.