Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to get a custom WP_Query in the global $post
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