Software Engineering in WordPress, PHP, and Backend Development

Search: “wp_query” (Page 2 of 29)

We found 145 results for your search.

How To Use WP_User_Query For WordPress User Queries

[…] its API with each new release. Recall that The Right Way™ was once to use query_posts in order to retrieve post data. However, as of recent releases, WP_Query has become The Right Way™ to do it. It’s a cleaner interface, more powerful, and is the way that’s backed by Automattic and the developer community […]

Using WP_Query To Get Posts From Last Week

One of the most powerful aspects of the WordPress API is WP_Query as it allows us to retrieve a wide variety of content through a relatively simple interface. That is, it allows us to retrieve complicated datasets ranging from custom post types, post status, date ranges, taxonomies, meta data, categories, and so on all […]

Using WP_Query and Multiple Meta Keys

When it comes to searching the WordPress database, there’s probably no better API than WP_Query. That doesn’t mean it’s not without it’s limitations, though (only which will be improved over time, I’m sure). For example, consider the case where you have two types of meta data that are completely unrelated and you need to […]

Add Custom Link to All Posts Screen Based on Post Meta Data

[…] for this linked at the bottom of the post. Anyway, I’ll start off by adding an anonymous function attached to the aforementioned hook: add_action( ‘pre_get_posts’, function ( WP_Query $query ) { // … } ); Notice that the anonymous function accepts a single argument which is a reference to the current instance of WP_Query […]

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑