It’s not a hack, this is what databases are designed for- querying large quantities of data. If you’re concerned about load, you should employ caching on data that doesn’t change frequently.
That said, you should not be using query_posts
to create additional queries. Really, you shouldn’t be using query_posts at all. Create additional queries via WP_Query
.
Related Posts:
- Using OR conditions in meta_query for query_posts argument
- Pass the same object to multiple widgets in a template with one query
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Optimising WP_Query with ACF Fields
- ACF: using two loops, the_field returns field content from another loop
- When should you use WP_Query vs query_posts() vs get_posts()?
- Get post ids from WP_Query?
- Some doubts about how the main query and the custom query works in this custom theme?
- How to query for most viewed posts and show top 5
- Query Multiple Post types each with own meta query
- Get posts by menu ID
- WordPress Custom Query to show posts from last x years
- Perform query with meta_value date
- Meta Query with date and time on the same Day before given time
- get_the_title($postID) OR get_the_title()?
- How do I create my own nested meta_query using posts_where / posts_join?
- Best practice for multiple queries on page
- Which custom query am I in and how can I access its properties & methods?
- Single page theme
- How to find out what “Blog pages show at most” is set to [duplicate]
- Retrieve or Query Pages by ID
- How do you query wordpress posts using a math formula between multiple meta field values?
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Query Posts depends on custom field inside repeater field using acf
- Multiple instances of Featured Image Query
- How do you Query posts with nothing in common?
- Custom category search box for WordPress
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- Query with a meta value inside a given range
- ACF Date Based wp_query
- Store sticky post’s ids in a transient
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- Multiple loops without repeating content
- Any number in meta key (wp query)
- How do I run through a WordPress loop called from a filter function?
- Bypass “supress_filters” in WP Query
- add_filter(‘query_vars’) not working in custom template
- How to display an other custom post type in a different custom post type’s archive?
- Display custom tags on pages that have a specific page parent
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- wordpress ajax relationship query
- ACF: post query, hide duplicate values [closed]
- Exclude All Posts Which Do Not Have A Tag Assigned
- Easy way to write complex queries in wordpress
- get_posts output always same post
- WordPress Custom Search Form Displaying Unexpected Results
- Conditional operator OR not working with custom fields
- complex get_posts() query to select child pages
- Get posts that do not have the same tags as current
- Utilising an existing page while using the “s” query parameter
- JSON – Create rest api endpoint for Advanced Custom Fields
- Should I reset $wp_query?
- Get posts in taxonomy randomly
- Posts query according to meta box date
- Expecting statement error from php loop using ACF plugin
- Custom query filter by ACF date custom field
- How do I add a relation parameter to my filter query?
- Get next/prev image/attachment in time with date query
- Max Posts and Memory Limit
- Why doesn’t my WP Meta Query return any results?
- How to query for a page, get data, then query for child pages of that page
- odd behaviours from template tags
- WP Query orderby ACF boolean values and ACF field value
- Query post and sort by custom value calculated with custom field on cpt
- Filter products on category AND tag
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- WP_Query – display posts by custom field and order by another
- Query post ordered by meta value that show first post that contained a tag
- Excluding posts from search results page with meta query not working
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- pre_user_query vs pre_get_posts
- How do I stop the same post showing multiple times in a archive?
- Query for getting posts with their custom fields data in WordPress
- How to rearrange posts based on input field values added by WordPress “Advanced Custom Fields”
- WP Query with meta queries
- Problem with my loops
- Query string order by custom field
- My entry results are not consistently alphabetized
- Orderby query does not work for custom fields even with meta query
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- query_posts() doesn’t seem to be called in my page
- Modify query to exclude certain ids and certain parents and its corresponding children
- Object of class WP_Query could not be converted to int inside shortcode
- Fetching $_POST from Page Template into functions.php
- How to order by datediff in WP loop?
- WP_Query within save_post doesn’t include the item that triggered the action?
- Issue in If else condition [closed]
- Optimising specific Query with ACF meta objects
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Passing query variables to a custom page template
- query_posts with sorting on a custom datestamp
- Query Posts by date range with fixed beginning and end
- Exclude categories and subcategories in QueryLoop
- Display all custom meta field values from the database using ACF Repeater
- Adding css tweak based on page template
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Incorrect posts displayed on category page
- I want to place a post before all others from an ACF boleen field
- Use value from meta key array for use in WP_Query