get_queried_object(): How and Why to Use It
WordPress's get_queried_object() function has the distinction of being, I think, the most useful core function in WordPress that I didn't know about for
Extending WP_Query with Custom Queries and Tables
Retrieveing data using get_posts or WP_Query can be challenging when we need to include custom tables in the query. In this tutorial, we will learn how to include our custom tables to create custom queries. The idea for this tutorial […]
Nested Loops and Custom WordPress Queries | EngageWP
Create a complex WordPress query and nested loop to output posts from a Movie post type and organized by a movie_years custom taxonomy.
Building Efficient WordPress Queries with WP_Query
In this tutorial, we'll show you how to use the WP_Query class specifically to optimize the SQL queries, reducing execution time and resource consumption.
How to Write a WP_Query for Multiple Specific Post IDs
Recently, a client project I’m working on required something I don’t think I’ve done before: write a WP_Query to fetch a dynamically generated list of post IDs.
Use the built-in post counter
<?php /** * Use the built-in post counter * * Sometimes you'll want to keep track of which post you're on in a loop. * Some people create their own $loop_counter (ex: Genesis, https://gist.github.com/…
Querying Event Post Types with WP Query and The Event Calendar
Here's how to start querying event post types with WP Query for The Event Calendar and the base level of arguments you need.
Advanced Post Queries - Understanding the WordPress WP_Query object
Learn how to use and filter metadata by leveraging the WP_Query object to save hours off your development time and improve your product's code.
How to Build Efficient Queries in WordPress - Kinsta Blog
In this tutorial, we'll show you how to use the WP_Query class specifically to optimize the SQL quer...
Practical Uses of pre_get_posts | WPShout
In WordPress, pre_get_posts is a filter that makes it possible to modify an existing WP_Query, befor...
Using WP_Query Objects Without the Loop | WPShout
I really enjoyed David's article from a few weeks ago on the basics of functional programming as it ...
ACF | Query posts by custom fields
This article will demonstrate how to retrieve an array of post objects from the database using nativ...
ACF | Order posts by custom fields
This article will demonstrate how to retrieve and sort an array of post objects from the database us...
An In-Depth Guide to Conquering WP_Query - WPMU DEV
Mixed relationship taxonomy queries in WordPress | 10up
Using WP_Query in WordPress
Michael Fields » Post Format Queries