wpdb get last query
echo $wpdb->last_query;
query lastet wp
<?php
// The Query
$next_args = array(
'post_type' => '<your_post_type>',
'post_status' => 'publish',
'posts_per_page'=>2,
'order'=>'DESC',
'orderby'=>'ID',
);
$the_query = new WP_Query( $args );
// The Loop
if ( $the_query->have_posts() ) {
$not_in_next_three = array();
while ( $the_query->have_posts() ) {
$the_query->the_post();
//your html here for latest 2
$not_in_next_three[] = get_the_ID();
}
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us