Get Page Type (Category/Tag) Using AJAX

One thing you could do is set a variable in the archive.php like <script>var isArchive = true;</script>. Or in any template do if (is_archive()) { /* set the variable */ }. And then in the JS file do if (typeof isArchive != ‘undefined’) { } but there are probably way more elegant solutions that I’m … Read more

Know which script/page is being called by ajax call

Open the website with Web Developer tools or Browser inspection tools ( Firebug )etc and then Run “Console”. Refresh your website and see the Ajax calls. Check the POST window in Ajax call to see action script. That’d tell you the exact function being called.

Simulate a specific page when making AJAX calls

The issue turned out to be elsewhere. But I did learn that there is no way to overwrite the queried URL directly, as it comes from $_SERVER variables. The answer here had some code for anyone who wants to do that: https://stackoverflow.com/questions/10739721/wordpress-ajax-parse-url

WordPress Get Header and Footer using in Admin Area

A very simple experiment… add_action(‘admin_init’,’get_header’); add_action(‘admin_init’,’get_footer’); … will demonstrate that the get_header() and get_footer() functions work on the back end as well as the front, though you will need to adjust for numerous markup problems and other issues. Honestly, you question seems to be “how do I get the site header and footer and use … Read more