Software Engineering in WordPress, PHP, and Backend Development

Search: “wp_query” (Page 1 of 10)

We found 48 results for your search.

How To Setup Custom Queries For WP_Query Pagination

[…] expected. Ultimately, it required me passing a little bit more information to the query’s arguments array and to the pagination link functions. Here’s how you can setup WP_Query Pagination to work properly in custom queries. A Few Assumptions There are two assumptions that I’m making about your setup: You’re using pretty permalinks. That is, […]

Writing Clean, Maintainable Custom WordPress Queries

[…] Query for the 10 most recent posts by the specified users $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 10, ‘author’ => $featured_user_ids ); $the_query = new WP_Query( $args ); // Finally, loop through the posts while ( $the_query->have_posts() ) { $the_query->the_post(); /* Snipped for brevity, but this is where the markup would render […]

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 […]

« Older posts

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑