Load page HTML content through AJAX

An AJAX request is a request from a client like any other request. Just request the URL like normal, but with Javascript. As far as that goes, this should be simple. If you’ve done item #2– “I’ll wrap the header/footer/sidebars…”– correctly there should be no problem except that page specific functions won’t run. That is going to be the problem you have to tackle. I can see it being a problem in a number of circumstances.

Say you have something hooked to wp_head that only executes, and needs to execute, when a specific theme template loads. In your system that would work only if the initial page load is for that template. If you load some other page and then load the template over AJAX, functions hooked to wp_head, or to any conditionally executed hooks`, will not run.

Your AJAX callback is going to have to process a number of hooks– wp_header, wp_head, wp_footer… I am sure there are more. It could get complicated.