<?php | |
global $wp_query; | |
$posts = wp_list_pluck( $wp_query->posts, 'ID' ); |
Returns an array of post IDs in the main query. Useful when doing a secondary query and you don’t want to have duplicate posts.
<?php | |
global $wp_query; | |
$posts = wp_list_pluck( $wp_query->posts, 'ID' ); |
Returns an array of post IDs in the main query. Useful when doing a secondary query and you don’t want to have duplicate posts.