Loading partial templates with AJAX/PJAX
I am trying to load content using PJAX (basically AJAX with history). So far I have managed to catch PJAX requests and load the correct content.
My problem is finding the correct template to use for each page. Currently I am using...
$post_type = get_post_type(); locate_template($post_type.'.php', true);
This sort of works but it's not perfect. For example it will never hit
front-page.php. Is there a "right" way to do this? What am I missing?