you could use wp_list_pluck();
if ( $exclude_featured )
$args['post__not_in'] = wp_list_pluck( $exclude_featured->posts, 'ID' );
$args['posts_per_page'] = 999;
query_posts( $args );
endif;
while ( have_posts() ) : the_post();
...
Related Posts:
- why ignore_sticky_posts in sticky post query
- Sticky Posts & Posts Per Page [closed]
- All sticky posts are returned in custom query
- Include Sticky Posts in Page Post Count for custom query
- Query sticky posts with thumbnails
- Sticky Post default functionality with WP_Query is ignored when using AJAX
- Excluding Sticky Posts from The Loop and from WP_Query() in WordPress?
- WP_Query doesn’t get sticky post at the top, when used in a page template
- Store sticky post’s ids in a transient
- Show Sticky Post at the top but do not show again in the loop?
- wp_query should show stickies first
- WP Query to have sticky posts first, with pagination and having a joint ‘posts per page’ arg with main loop
- How can I allow sticky posts but cap the query to 1 post?
- How to remove only the latest sticky post from the loop
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- Add to search posts query array with post IDS which will appear first
- why ignore_sticky_posts in sticky post query
- Seach and categories not working when ignoring sticky posts in main loop
- Pull posts from all categories if quantity is not met?
- counting post from a wp-query using sticky_post
- WP_Query causing links to not work
- WP Query with sticky posts and tax_query
- Trying to Exclude Sticky Posts From date_query
- Show sticky post before other WP_Query
- Multiple loops on index page with sticky post and pagination
- First post outside of loop, homepage only?
- How can I display sticky posts at first in wp_query?
- Why ignore_sticky_posts argument is in sticky post query?
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Wp_redirect and sending variables
- How do I get posts that have a thumbnail in WP_Query?
- Multiple WP_Query loops with Pagination
- WP_Query – filter or directly?
- WP_Query with checkbox meta_query
- IP address character limit
- How can I save an array from a random post sequence for later use?
- Does WordPress generate an automatic page for post formats?
- Why is WP-Query spelled like it is?
- How to add custom query filters in WP_User_Query
- How to order category.php loop by ‘meta_value’?
- Searching user meta using WP_User_Query
- WP API to fetch all the media/posts records if count is more than 100
- Shortcode returns escaped HTML tags
- Get number of comments after modifying comment query
- How to change a custom query into a standard loop?
- How can i make WP_Query return post image and categories?
- Get image of latest post from taxonomies/categories
- 2 loops on page – one with orderby rand second orderby date
- WP_Query returning no results
- Splice together 2 WP_Query objects
- How to access a query twice in different template files?
- Counter problem, infinite loop when post_per_page equals X
- How to create a WordPress Post Filter that users can use to filter posts by year?
- Exclude category for main query and custom
- Complex Category selection as per user input
- How to set multiple `orderby` in query argument?
- WP_Query posts_per_page Only Bringing Back one post
- How to get all unique categories for posts in loop?
- Query that loads a custom type AND posts whose ids are not inside those custom types custom fields
- Meta_query with multiple keys and multiple values
- WordPress WP_Query make mysql time out
- Get authors by term id or slug
- Transient not behaving as expected
- Multisite wp_query & switch_to_blog issue
- the_post() within switch_to_blog() altering my excerpt
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- empty WP_Query object on local install
- Query posts only without featured image
- How to use WP_Query() on single.php?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- Loop increase in while loop not working
- Appending to existing WP_Query’s meta_query if exists
- How To Keep Search Title the same on paged Results
- Get next/prev image/attachment in time with date query
- Filter out a meta key in the Search results page with two CPT
- How to add a recent post function to a text widget I created for practice?
- Can I make a search query which includes a space?
- Help with if statement inside while loop
- WP_Query – display posts by custom field and order by another
- Pin posts to top of custom loop
- WP_Query no result if keyword contains number
- WP_QUERY order posts by two combined meta_value dates
- Order by value of Custom Field using url string
- How to set meta_query if get_post_meta returns nested array for that key? [duplicate]
- Is the ‘parse_query’ filter still valid to change filtered content on admin list view?
- WP_Query returns empty if meta_query has more than 7 values
- query.php – multiple is_category functions
- Custom query with post_class filter using current_post not working
- Overwriting auto-appended NOT IN query in WP_Query
- posts_per_page not returning correct number of posts
- query_posts with sorting on a custom datestamp
- Conditionals in WP_Query
- Why WP_Query in functions.php is not working when get_posts works?
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Loop the posts between two dates selected using jquery datepicker
- query by meta value then date and not empty meta value
- Issue with sorting by post date and custom post type
- Can’t get LIKE to work with wp_query [closed]
- Is there another way to retrieve a post_id from post_meta other than a SQL query?