Software Engineering in Web Development, Backend Services, and More

Search: “wp_query” (Page 6 of 29)

We found 145 results for your search.

WordPress Custom Post Type Pagination

Generally speaking, whenever I work with custom post type pagination, it’s done so by writing a custom query using WP_Query and then calling wp_reset_postdata() at the end of The Loop. I still think this has its place, but there is a simpler solution that you may be able to implement using a specific hook that WordPress […]

How To Get Post Content By Title

[…] it comes to retrieving content outside of The Loop or retrieving content based on certain criteria, it’s usually a matter of setting up a custom query using WP_Query. But sometimes, setting up a full custom query, executing the loop, then resetting the post data isn’t required. Case in point: I was recently working on […]

A Stub for Working with Database Queries in WordPress

As much as I am a fan of certain WordPress APIs for querying the database such as: WP_Query, WP_User_Query, WP_Meta_Query, and so on I’m also a fan of querying directly against the database when needed. As you’ll notice, there’s a consistent way that I go about doing this and since there are times where […]

Escaping Strings For WordPress Database Queries

[…] you may never need to use $wpdb. I see it used far more often than is necessary. By that, I mean we can normally get away with WP_Query, WP_User_Query, or a similar API before we need to talk directly to the database. But let’s say that you’re working with a custom table or a […]

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑