Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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' );
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.