Hi,
I’ve watched the #81: AJAXing a WordPress Theme tutorial on this site (https://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/)
And I tried implementing the code, with help of this one as well http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html
I got the include right but when I activate it it doesn’t load anything into the content area when I press any link in my site, just stick at the homepage
My file is:
ajax.js:
jQuery(document).ready(function($) {
var $mainContent = $("#content"),
siteUrl = "http://" + top.location.host.toString(),
url = '';
$(document).delegate("a[href^='"+siteUrl+"']:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/])", "click", function() {
location.hash = this.pathname;
return false;
});
$("#searchform").submit(function(e) {
location.hash = '?s=' + $("#s").val();
e.preventDefault();
});
$(window).bind('hashchange', function(){
url = window.location.hash.substring(1);
if (!url) {
return;
}
url = url + " #content";
$mainContent.animate({opacity: "0.1"}).html('Please wait...>').load(url, function() {
$mainContent.animate({opacity: "1"});
});
});
$(window).trigger('hashchange');
});
My site… : http://www.soniagarcia.co.il/?lang=en
Any help would be appreciated