I'm developing a theme and I want to ajaxify each internal link in my theme. Uptill now, i've used
admin-ajax.php method successfully for these actions ...
1: Load More Posts for Blog with Ajax
2: Open Single Blog Post with Ajax
And i've used seperate .js scripts and ajax callback function for each of the above action. But the issue is if i want to ajaxify whole of my wordpress theme i'll have to code many such scripts and callback functions for each internal link e.g author page, search page, default page template, custom page template ... etc.
Now, i want to ask ...
1: Is it the only way to ajaxify your whole site or if there is any better way? Cannot we use
.load() method with less usage of code? (as in
.load() method we only have to specify the URL to load irrespective of the fact that which page we are loading)
admin-ajax.php method is preferred vs