Skip to content

Instantly share code, notes, and snippets.

@palmiak

palmiak/wp.php Secret

Created May 31, 2017
Embed
What would you like to do?
<?php
// current post ID
$current_id = get_the_ID();
$inner_args = array(
p => $current_id
);
$inner_query = new WP_Query( $inner_args );
if ( $inner_query->have_posts() ) {
// your code
}
$inner_args = array(
'post_type' => 'post-type',
'posts_per_page' => -1,
'post__not_in => [ $current_id ]
);
$inner_query = new WP_Query( $inner_args );
if ( $inner_query->have_posts() ) {
// your code
}
//rest of your code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.