Created
November 22, 2012 11:49
-
-
Save roborourke/4130750 to your computer and use it in GitHub Desktop.
Hide get_header() and get_footer() calls when loading wp URLs not via wp ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// makes sure every ajax request has the 'is_ajax' parameter sent whether its using the WP ajax API or not | |
$.ajaxSetup( { | |
data: { is_ajax: 1 } | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// can't find a neater solution :( | |
if ( ! isset( $_REQUEST['is_ajax'] ) ) get_header(); | |
if ( ! isset( $_REQUEST['is_ajax'] ) ) get_footer(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment