Created
February 3, 2017 22:03
-
-
Save coderaaron/d2f629f2f91d7b86cf9188df38148cec to your computer and use it in GitHub Desktop.
How to get a custom WP_Query in the global $post
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
global $ppi_query; | |
... | |
$ppi_query = new WP_Query( $args ); | |
... | |
global $ppi_query; | |
global $post; | |
if ( $ppi_query ==null ) { $ppi_query = $wp_query; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment