setup_postdata will let you use loop functions with post results via get_posts
.
another option is to use the various filters available to alter WP_Query
‘s behavior- posts_join
, posts_where
, posts_orderby
.
Related Posts:
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Display products from specific category in shop page
- Exclude post on loop by multiple meta key value
- How to change a custom query into a standard loop?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to count data records in wordpress which have same meta_value in wp_postmeta table?
- Query sticky posts with thumbnails
- WP_Query on custom field and order results
- Any number in meta key (wp query)
- Filtering posts from different categories into different section by doing WP_Query only once
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Query most popular terms by taxonomy over 2 week period
- Custom taxonomy.php not working
- Array as ‘key’ in WP_Query
- How to provide meta_key array to wp_query?
- Wp_query with 2 meta keys and array of meta values
- Meta query compare for ID’s greater than specific ID
- WP_Query not returning correct result with meta_query parameter
- show most viewed post
- Meta Query if Values Don’t Exist
- Custom query (author is post_author or meta co_author) with Pagenavi pagination
- Output ACF field dynamicaly within a taxonomy loop [closed]
- get_post_meta bringing back results, but $wpdb->postmeta doesn’t
- Nested meta_query with multiple relation keys
- WP_Query vs get_posts
- Order posts by ID in the given order
- Query Multiple Post types each with own meta query
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Get the number of posts from the current page results
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- WP Meta Query for some meta (array) values
- Get number of comments after modifying comment query
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- WP Query – Get WooCommerce Products with variation that is in stock
- Meta_query with or without value
- $wpdb->insert inserting two rows in database
- Get image of latest post from taxonomies/categories
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- 2 loops on page – one with orderby rand second orderby date
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- wp_query not searching with apostrophe
- $wpdb select date range of posts
- Counter problem, infinite loop when post_per_page equals X
- How to delete taxonomy term when a wordpress user is removed?
- Custom query based on meta key – Reduce three states to two in results?
- Performance when getting post meta for post retrieved by meta value
- Wp_query function to search from product_title ‘OR’ product tags name
- How to display multiple custom fields with the same meta_key in an ascending order?
- Using the_post_thumbnail resets current loop item ID
- Meta_query with multiple keys and multiple values
- Tax query AND/OR meta query [duplicate]
- Help ordering Post loop by two meta values
- New WP_Query loop in admin causes problems
- Need to convert string of term ids into comma separated integers for use in an arguments array
- How do I get my custom query to work with search results after the first page?
- Issue with front page navigation after upgrading to 3.4
- Exclude recently updated post from custom WP_Query using multiple loops
- get_posts output always same post
- difference between querying database and using the loop
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Appending to existing WP_Query’s meta_query if exists
- Continue or break the while loop
- Loop posts based on permalink term
- Custom query filter by ACF date custom field
- Error in meta_query not get result
- Does putting queries within loops cause an issue on WordPress?
- How to get current page nearest parent id?
- Disable (or limit) queries when certain content (or data) is not needed (or showed)
- Sort posts using multiple custom fields and menu_order in single query?
- Order (by ASC) posts with meta_key so posts without values are last
- Search filter between promo and exact price
- Bootstrap grid while loop
- Why can my filter query SOME metadata but not other metadata?
- Getting posts by custom field value
- How can I use WP_Query to sort ‘event’ custom post type by date?
- wordpress multiple meta value query is not working
- Strange results from WP_Query
- Display posts side by side with custom query
- Pre get posts sort by meta key returns no results if meta key does not exist
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- WP Query for Multiple Post Types
- Order Posts By Custom Field That is an array of objects
- Orderby query does not work for custom fields even with meta query
- Select Unique Posts for a List of Tags
- Some doubts about how the main query and the custom query works in this custom theme?
- Ordering Posts by parent category, name ascending
- Use not custom fields in get_posts() meta_query?
- WP_Query a custom field value bringing back 0 results
- Set Transient on CPT
- Load 3 posts in flexslider slide [closed]
- Multiple wp_query loops showing first 5 posts on all pages instead of older posts[Resolved]
- How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
- $query conflicting with other queries in the same page
- WordPress Post Looping? [duplicate]
- Wp query by 2 meta field – check if they exists / have value
- Show linked products using wp query and woocommerce
- Standard Loop – wp_query
- Custom Wp_query loop takes very long