-
-
Save palmiak/34389b42a33667de1a57194d21871fde to your computer and use it in GitHub Desktop.
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 | |
// 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