‘showposts’ breaks WP_Query
-
When using WP_Query to setup multiple loops, if you attempt to pass showposts to limit the number of posts to display, the query to the database does not work properly. Examples:
Category Queries
new WP_Query(‘category_name=mycat’); //works
new WP_Query(‘category_name=mlb&showposts=5’); //showposts does nothingAuthor Queries
new WP_Query(‘author_name=myauth’); //works
new WP_Query(‘author_name=myauth&showposts=1’); //showposts does nothingIn all these blocks of code I’m using a standard while loop, and I need to limit the data returned in the db query.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘‘showposts’ breaks WP_Query’ is closed to new replies.