I’ve covered WP_User_Query in a previous post. In short, WP_User_Query is the preferred method for retrieving user information from the database when working with custom queries. One of the shortcomings of this API method is that it doesn’t allow you to query across multiple roles. So, for example, if you want to retrieve users that […]
Search: “wp_query” (Page 3 of 29)
We found 145 results for your search.
One of the most powerful features of WP_Query is that it allows for us to create a type of mini-search engine within the context of our WordPress projects. No, this isn’t as sophisticated as something or someone who’s actually in the search business, but you can create some pretty elaborate queries using WP_Query. Conversely, […]
[…] a page post type The meta value is “This page is locked.” There are two ways that we can go about actually retrieving this information. 1. Using WP_Query and The Loop The first way that you can retrieve a post’s ID through it’s meta value is by using WP_Query. The only information you really need […]
When it comes to programming – regardless of the platform, language, or system that you’re using – there’s a concept of abstraction that most programmers understand even if they don’t know that that’s what the concept is called. Perhaps the clearest definition on abstraction in programming (straight from Wikipedia) explains: Abstraction is the process by which […]
TL;DR: If you’re looking for an easy way to sort WordPress posts by date (be it descending or ascending) in the administration area without having users click on the Date column header, you can do so through the use of the pre_get_posts filter that provides a reference to the instance WP_Query running on the page. […]
