WP_Query Arguments
[pastacode lang= »php » manual= »%3C%3Fphp%0A%2F**%0A*%20WordPress%20Query%20Comprehensive%20Reference%0A*%20CODEX%3A%20http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_Query%0A*%20Source%3A%20http%3A%2F%2Fcore.trac.wordpress.org%2Fbrowser%2Ftags%2F3.3.1%2Fwp-includes%2Fquery.php%0A*%2F%0A%20%0A%24args%20%3D%20array(%20%0A%20%20%0A%2F%2F%2F%2F%2F%2FAuthor%20Parameters%20-%20Show%20posts%20associated%20with%20certain%20author.%0A%20%20%20%20’author’%20%3D%3E%201%2C2%2C3%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20use%20author%20id%20%5Buse%20minus%20(-)%20to%20exclude%20authors%20by%20ID%20ex.%20’author’%20%3D%3E%20-1%2C-2%2C-3%2C%5D%0A%20%20%20%20’author_name’%20%3D%3E%20’luetkemj’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20use%20’user_nicename’%20(NOT%20name)%0A%20%20%0A%2F%2F%2F%2F%2F%2FCategory%20Parameters%20-%20Show%20posts%20associated%20with%20certain%20categories.%0A%20%20%20%20’cat’%20%3D%3E%205%2C%2F%2F(int)%20-%20use%20category%20id.%0A%20%20%20%20’category_name’%20%3D%3E%20’staff’%2C%20’news’%2C%20%20%20%20%20%20%20%2F%2F(string)%20-%20use%20category%20slug%20(NOT%20name).%0A%20%20%20%20’category__and’%20%3D%3E%20array(%202%2C%206%20)%2C%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20category%20id.%0A%20%20%20%20’category__in’%20%3D%3E%20array(%202%2C%206%20)%2C%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20category%20id.%0A%20%20%20%20’category__not_in’%20%3D%3E%20array(%202%2C%206%20)%2C%20%20%20%20%20%20%2F%2F(array)%20-%20use%20category%20id.%0A%20%20%20%20%20%0A%2F%2F%2F%2F%2F%2FTag%20Parameters%20-%20Show%20posts%20associated%20with%20certain%20tags.%0A%20%20%20%20’tag’%20%3D%3E%20’cooking’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20use%20tag%20slug.%0A%20%20%20%20’tag_id’%20%3D%3E%205%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20use%20tag%20id.%0A%20%20%20%20’tag__and’%20%3D%3E%20array(%202%2C%206)%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20tag%20ids.%0A%20%20%20%20’tag__in’%20%3D%3E%20array(%202%2C%206)%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20tag%20ids.%0A%20%20%20%20’tag__not_in’%20%3D%3E%20array(%202%2C%206)%2C%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20tag%20ids.%0A%20%20%20%20’tag_slug__and’%20%3D%3E%20array(%20’red’%2C%20’blue’)%2C%20%2F%2F(array)%20-%20use%20tag%20slugs.%0A%20%20%20%20’tag_slug__in’%20%3D%3E%20array(%20’red’%2C%20’blue’)%2C%20%20%2F%2F(array)%20-%20use%20tag%20slugs.%0A%20%20%0A%2F%2F%2F%2F%2F%2FTaxonomy%20Parameters%20-%20Show%20posts%20associated%20with%20certain%20taxonomy.%0A%20%20%2F%2FImportant%20Note%3A%20tax_query%20takes%20an%20array%20of%20tax%20query%20arguments%20arrays%20(it%20takes%20an%20array%20of%20arrays)%0A%20%20%2F%2FThis%20construct%20allows%20you%20to%20query%20multiple%20taxonomies%20by%20using%20the%20relation%20parameter%20in%20the%20first%20(outer)%20array%20to%20describe%20the%20boolean%20relationship%20between%20the%20taxonomy%20queries.%0A%20%20%20%20’tax_query’%20%3D%3E%20array(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20taxonomy%20parameters%20(available%20with%20Version%203.1).%0A%20%20%20%20’relation’%20%3D%3E%20’AND’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Possible%20values%20are%20’AND’%20or%20’OR’%20and%20is%20the%20equivalent%20of%20ruuning%20a%20JOIN%20for%20each%20taxonomy%0A%20%20%20%20%20%20array(%0A%20%20%20%20%20%20%20%20’taxonomy’%20%3D%3E%20’color’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Taxonomy.%0A%20%20%20%20%20%20%20%20’field’%20%3D%3E%20’slug’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Select%20taxonomy%20term%20by%20(‘id’%20or%20’slug’)%0A%20%20%20%20%20%20%20%20’terms’%20%3D%3E%20array(%20’red’%2C%20’blue’%20)%2C%20%20%20%20%2F%2F(int%2Fstring%2Farray)%20-%20Taxonomy%20term(s).%0A%20%20%20%20%20%20%20%20’include_children’%20%3D%3E%20true%2C%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20-%20Whether%20or%20not%20to%20include%20children%20for%20hierarchical%20taxonomies.%20Defaults%20to%20true.%0A%20%20%20%20%20%20%20%20’operator’%20%3D%3E%20’IN’%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Operator%20to%20test.%20Possible%20values%20are%20’IN’%2C%20’NOT%20IN’%2C%20’AND’.%0A%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20array(%0A%20%20%20%20%20%20%20%20’taxonomy’%20%3D%3E%20’actor’%2C%0A%20%20%20%20%20%20%20%20’field’%20%3D%3E%20’id’%2C%0A%20%20%20%20%20%20%20%20’terms’%20%3D%3E%20array(%20103%2C%20115%2C%20206%20)%2C%0A%20%20%20%20%20%20%20%20’include_children’%20%3D%3E%20false%2C%0A%20%20%20%20%20%20%20%20’operator’%20%3D%3E%20’NOT%20IN’%0A%20%20%20%20%20%20)%0A%20%20%20%20)%2C%0A%2F%2F%2F%2F%2F%2FPost%20%26%20Page%20Parameters%20-%20Display%20content%20based%20on%20post%20and%20page%20parameters.%0A%20%20%20%20’p’%20%3D%3E%201%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20use%20post%20id.%0A%20%20%20%20’name’%20%3D%3E%20’hello-world’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20use%20post%20slug.%0A%20%20%20%20’page_id’%20%3D%3E%201%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20use%20page%20id.%0A%20%20%20%20’pagename’%20%3D%3E%20’sample-page’%2C%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20use%20page%20slug.%0A%20%20%20%20’pagename’%20%3D%3E%20’contact_us%2Fcanada’%2C%20%20%20%20%20%20%2F%2F(string)%20-%20Display%20child%20page%20using%20the%20slug%20of%20the%20parent%20and%20the%20child%20page%2C%20separated%20ba%20slash%0A%20%20%20%20’post_parent’%20%3D%3E%201%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20use%20page%20id.%20Return%20just%20the%20child%20Pages.%0A%20%20%20%20’post__in’%20%3D%3E%20array(1%2C2%2C3)%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20post%20ids.%20Specify%20posts%20to%20retrieve.%0A%20%20%20%20’post__not_in’%20%3D%3E%20array(1%2C2%2C3)%2C%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20use%20post%20ids.%20Specify%20post%20NOT%20to%20retrieve.%0A%20%20%20%20%2F%2FNOTE%3A%20you%20cannot%20combine%20’post__in’%20and%20’post__not_in’%20in%20the%20same%20query%0A%2F%2F%2F%2F%2F%2FType%20%26%20Status%20Parameters%20-%20Show%20posts%20associated%20with%20certain%20type%20or%20status.%0A%20%20%20%20’post_type’%20%3D%3E%20array(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string%20%2F%20array)%20-%20use%20post%20types.%20Retrieves%20posts%20by%20Post%20Types%2C%20default%20value%20is%20’post’%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20’post’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20post.%0A%20%20%20%20%20%20%20%20%20%20%20%20’page’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20page.%0A%20%20%20%20%20%20%20%20%20%20%20%20’revision’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20revision.%0A%20%20%20%20%20%20%20%20%20%20%20%20’attachment’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20an%20attachment.%20The%20default%20WP_Query%20sets%20’post_status’%3D%3E’published’%2C%20but%20atchments%20default%20to%20’post_status’%3D%3E’inherit’%20so%20you’ll%20need%20to%20set%20the%20status%20to%20’inherit’%20or%20’any’.%0A%20%20%20%20%20%20%20%20%20%20%20%20’my-post-type’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20Custom%20Post%20Types%20(e.g.%20movies)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%20%20%0A%20%20%20%20’post_status’%20%3D%3E%20array(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string%20%2F%20array)%20-%20use%20post%20status.%20Retrieves%20posts%20by%20Post%20Status%2C%20default%20value%20i’publish’.%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20’publish’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20published%20post%20or%20page.%0A%20%20%20%20%20%20%20%20%20%20%20%20’pending’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20post%20is%20pending%20review.%0A%20%20%20%20%20%20%20%20%20%20%20%20’draft’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20post%20in%20draft%20status.%0A%20%20%20%20%20%20%20%20%20%20%20%20’auto-draft’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20newly%20created%20post%2C%20with%20no%20content.%0A%20%20%20%20%20%20%20%20%20%20%20%20’future’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20post%20to%20publish%20in%20the%20future.%0A%20%20%20%20%20%20%20%20%20%20%20%20’private’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20not%20visible%20to%20users%20who%20are%20not%20logged%20in.%0A%20%20%20%20%20%20%20%20%20%20%20%20’inherit’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20a%20revision.%20see%20get_children.%0A%20%20%20%20%20%20%20%20%20%20%20%20’trash’%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20post%20is%20in%20trashbin%20(available%20with%20Version%202.9).%0A%20%20%20%20%20%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%2F%2FNOTE%3A%20The%20’any’%20keyword%20available%20to%20both%20post_type%20and%20post_status%20queries%20cannot%20be%20used%20within%20an%20array.%20%0A%20%20%20%20’post_type’%20%3D%3E%20’any’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20retrieves%20any%20type%20except%20revisions%20and%20types%20with%20’exclude_from_search’%20set%20to%20true.%0A%20%20%20%20’post_status’%20%3D%3E%20’any’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20-%20retrieves%20any%20status%20except%20those%20from%20post%20types%20with%20’exclude_from_search’%20set%20to%20true.%0A%20%20%20%20%0A%2F%2F%2F%2F%2F%2FPagination%20Parameters%0A%20%20%20%20’posts_per_page’%20%3D%3E%2010%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20number%20of%20post%20to%20show%20per%20page%20(available%20with%20Version%202.1).%20Use%20’posts_per_page’%3D-1%20to%20show%20all%20posts.%20Note%20if%20the%20query%20is%20in%20a%20feed%2C%20wordpress%20overwrites%20this%20parameter%20with%20the%20stored%20’posts_per_rss’%20option.%20Treimpose%20the%20limit%2C%20try%20using%20the%20’post_limits’%20filter%2C%20or%20filter%20’pre_option_posts_per_rss’%20and%20return%20-1%0A%20%20%20%20’posts_per_archive_page’%20%3D%3E%2010%2C%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20number%20of%20posts%20to%20show%20per%20page%20-%20on%20archive%20pages%20only.%20Over-rides%20showposts%20anposts_per_page%20on%20pages%20where%20is_archive()%20or%20is_search()%20would%20be%20true%0A%20%20%20%20’nopaging’%20%3D%3E%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20-%20show%20all%20posts%20or%20use%20pagination.%20Default%20value%20is%20’false’%2C%20use%20paging.%0A%20%20%20%20’paged’%20%3D%3E%20get_query_var(‘page’)%2C%20%20%20%20%20%20%20%2F%2F(int)%20-%20number%20of%20page.%20Show%20the%20posts%20that%20would%20normally%20show%20up%20just%20on%20page%20X%20when%20usinthe%20%22Older%20Entries%22%20link.%0A%20%20%20%20%2F%2FNOTE%3A%20You%20should%20set%20get_query_var(%20’page’%20)%3B%20if%20you%20want%20your%20query%20to%20work%20with%20pagination.%20Since%20Wordpress%203.0.2%2C%20you%20dget_query_var(%20’page’%20)%20instead%20of%20get_query_var(%20’paged’%20).%20The%20pagination%20parameter%20’paged’%20for%20WP_Query()%20remains%20the%20same.%0A%2F%2F%2F%2F%2F%2FOffset%20Parameter%0A%20%20%20%20’offset’%20%3D%3E%203%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20number%20of%20post%20to%20displace%20or%20pass%20over.%0A%2F%2F%2F%2F%2F%2FOrder%20%26%20Orderby%20Parameters%20-%20Sort%20retrieved%20posts.%0A%20%20%20%20’order’%20%3D%3E%20’DESC’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Designates%20the%20ascending%20or%20descending%20order%20of%20the%20’orderby’%20parameter.%20Defaultto%20’DESC’.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FPossible%20Values%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’ASC’%20-%20ascending%20order%20from%20lowest%20to%20highest%20values%20(1%2C%202%2C%203%3B%20a%2C%20b%2C%20c).%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’DESC’%20-%20descending%20order%20from%20highest%20to%20lowest%20values%20(3%2C%202%2C%201%3B%20c%2C%20b%2C%20a).%0A%20%20%20%20’orderby’%20%3D%3E%20’date’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Sort%20retrieved%20posts%20by%20parameter.%20Defaults%20to%20’date’.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FPossible%20Values%3A%2F%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’none’%20-%20No%20order%20(available%20with%20Version%202.8).%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’ID’%20-%20Order%20by%20post%20id.%20Note%20the%20captialization.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’author’%20-%20Order%20by%20author.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’title’%20-%20Order%20by%20title.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’date’%20-%20Order%20by%20date.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’modified’%20-%20Order%20by%20last%20modified%20date.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’parent’%20-%20Order%20by%20post%2Fpage%20parent%20id.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’rand’%20-%20Random%20order.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’comment_count’%20-%20Order%20by%20number%20of%20comments%20(available%20with%20Version%202.9).%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’menu_order’%20-%20Order%20by%20Page%20Order.%20Used%20most%20often%20for%20Pages%20(Order%20field%20in%20the%20EdiPage%20Attributes%20box)%20and%20for%20Attachments%20(the%20integer%20fields%20in%20the%20Insert%20%2F%20Upload%20MediGallery%20dialog)%2C%20but%20could%20be%20used%20for%20any%20post%20type%20with%20distinct%20’menu_order’%20values%20(theall%20default%20to%200).%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’meta_value’%20-%20Note%20that%20a%20’meta_key%3Dkeyname’%20must%20also%20be%20present%20in%20the%20query.%20Note%20alsthat%20the%20sorting%20will%20be%20alphabetical%20which%20is%20fine%20for%20strings%20(i.e.%20words)%2C%20but%20can%20bunexpected%20for%20numbers%20(e.g.%201%2C%203%2C%2034%2C%204%2C%2056%2C%206%2C%20etc%2C%20rather%20than%201%2C%203%2C%204%2C%206%2C%2034%2C%2056%20as%20yomight%20naturally%20expect).%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’meta_value_num’%20-%20Order%20by%20numeric%20meta%20value%20(available%20with%20Version%202.8).%20Also%20notthat%20a%20’meta_key%3Dkeyname’%20must%20also%20be%20present%20in%20the%20query.%20This%20value%20allows%20for%20numericasorting%20as%20noted%20above%20in%20’meta_value’.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F’post__in’%20-%20Preserve%20post%20ID%20order%20given%20in%20the%20post__in%20array%20(available%20with%20Version%203.5).%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%20%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%20%0A%2F%2F%2F%2F%2F%2FSticky%20Post%20Parameters%20-%20Show%20Sticky%20Posts%20or%20ignore%20them.%0A%20%20%20%20’ignore_sticky_posts’%20%3D%3E%20false%2C%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20-%20ignore%20sticky%20posts%20or%20not.%20Default%20value%20is%20false%2C%20don’t%20ignore.%20Ignore%2Fexcludsticky%20posts%20being%20included%20at%20the%20beginning%20of%20posts%20returned%2C%20but%20the%20sticky%20post%20will%20still%20be%20returned%20in%20the%20natural%20order%20othat%20list%20of%20posts%20returned.%0A%20%20%20%20%2F%2FNOTE%3A%20For%20more%20info%20on%20sticky%20post%20queries%20see%3A%20http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_Query%23Sticky_Post_Parameters%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%20%0A%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%09%20%0A%2F%2F%2F%2F%2F%2FTime%20Parameters%20-%20Show%20posts%20associated%20with%20a%20certain%20time%20period.%0A%20%20%20%20’year’%20%3D%3E%202012%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%204%20digit%20year%20(e.g.%202011).%0A%20%20%20%20’monthnum’%20%3D%3E%203%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Month%20number%20(from%201%20to%2012).%0A%20%20%20%20’w’%20%3D%3E%20%2025%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Week%20of%20the%20year%20(from%200%20to%2053).%20Uses%20the%20MySQL%20WEEK%20command.%20The%20mode%20is%20dependenon%20the%20%22start_of_week%22%20option.%0A%20%20%20%20’day’%20%3D%3E%2017%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Day%20of%20the%20month%20(from%201%20to%2031).%0A%20%20%20%20’hour’%20%3D%3E%2013%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Hour%20(from%200%20to%2023).%0A%20%20%20%20’minute’%20%3D%3E%2019%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Minute%20(from%200%20to%2060).%0A%20%20%20%20’second’%20%3D%3E%2030%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(int)%20-%20Second%20(0%20to%2060).%0A%2F%2F%2F%2F%2F%2FCustom%20Field%20Parameters%20-%20Show%20posts%20associated%20with%20a%20certain%20custom%20field.%0A%20%20%20%20’meta_key’%20%3D%3E%20’key’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Custom%20field%20key.%0A%20%20%20%20’meta_value’%20%3D%3E%20’value’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Custom%20field%20value.%0A%20%20%20%20’meta_value_num’%20%3D%3E%2010%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(number)%20-%20Custom%20field%20value.%0A%20%20%20%20’meta_compare’%20%3D%3E%20’%3D’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Operator%20to%20test%20the%20’meta_value’.%20Possible%20values%20are%20′!%3D’%2C%20’%3E’%2C%20’%3E%3D’%2C%20’%3C’%2C%20or%20%3D’.%20Default%20value%20is%20’%3D’.%0A%20%20%20%20’meta_query’%20%3D%3E%20array(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(array)%20-%20Custom%20field%20parameters%20(available%20with%20Version%203.1).%0A%20%20%20%20%20%20%20array(%0A%20%20%20%20%20%20%20%20%20’key’%20%3D%3E%20’color’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Custom%20field%20key.%0A%20%20%20%20%20%20%20%20%20’value’%20%3D%3E%20’blue’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string%2Farray)%20-%20Custom%20field%20value%20(Note%3A%20Array%20support%20is%20limited%20to%20a%20compare%20value%20of%20’IN’%2C%20’NOT%20IN’%2C%20’BETWEEN’%2C%20or%20’NOT%20BETWEEN’)%0A%20%20%20%20%20%20%20%20%20’type’%20%3D%3E%20’CHAR’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Custom%20field%20type.%20Possible%20values%20are%20’NUMERIC’%2C%20’BINARY’%2C%20’CHAR’%2C%20’DATE’%2C%20’DATETIME’%2C%20’DECIMAL’%2C%20’SIGNED’%2C%20’TIME’%2C%20’UNSIGNED’.%20Default%20value%20is%20’CHAR’.%0A%20%20%20%20%20%20%20%20%20’compare’%20%3D%3E%20’%3D’%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Operator%20to%20test.%20Possible%20values%20are%20’%3D’%2C%20′!%3D’%2C%20’%3E’%2C%20’%3E%3D’%2C%20’%3C’%2C%20’%3C%3D’%2C%20’LIKE’%2C%20’NOT%20LIKE’%2C%20’IN’%2C%20’NOT%20IN’%2C%20’BETWEEN’%2C%20’NOT%20BETWEEN’.%20Default%20value%20is%20’%3D’.%0A%20%20%20%20%20%20%20)%2C%0A%20%20%20%20%20%20%20array(%0A%20%20%20%20%20%20%20%20%20’key’%20%3D%3E%20’price’%2C%0A%20%20%20%20%20%20%20%20%20’value’%20%3D%3E%20array(%201%2C200%20)%2C%0A%20%20%20%20%20%20%20%20%20’compare’%20%3D%3E%20’NOT%20LIKE’%0A%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%0A%2F%2F%2F%2F%2F%2FPermission%20Parameters%20-%20Display%20published%20posts%2C%20as%20well%20as%20private%20posts%2C%20if%20the%20user%20has%20the%20appropriate%20capability%3A%0A%20%20%20%20’perm’%20%3D%3E%20’readable’%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20Possible%20values%20are%20’readable’%2C%20’editable’%20(possible%20more%20ie%20all%20capabilitiealthough%20I%20have%20not%20tested)%0A%2F%2F%2F%2F%2F%2FParameters%20relating%20to%20caching%0A%20%20%20%20’no_found_rows’%20%3D%3E%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20Default%20is%20false.%20WordPress%20uses%20SQL_CALC_FOUND_ROWS%20in%20most%20queries%20in%20order%20timplement%20pagination.%20Even%20when%20you%20don%C3%A2%E2%82%AC%E2%84%A2t%20need%20pagination%20at%20all.%20By%20Setting%20this%20parameter%20to%20true%20you%20are%20telling%20wordPress%20not%20tcount%20the%20total%20rows%20and%20reducing%20load%20on%20the%20DB.%20Pagination%20will%20NOT%20WORK%20when%20this%20parameter%20is%20set%20to%20true.%20For%20more%20informatiosee%3A%20http%3A%2F%2Fflavio.tordini.org%2Fspeed-up-wordpress-get_posts-and-query_posts-functions%0A%20%20%20%20’cache_results’%20%3D%3E%20true%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20Default%20is%20true%0A%20%20%20%20’update_post_term_cache’%20%3D%3E%20true%2C%20%20%20%20%20%20%20%2F%2F(bool)%20Default%20is%20true%0A%20%20%20%20’update_post_meta_cache’%20%3D%3E%20true%2C%20%20%20%20%20%20%20%2F%2F(bool)%20Default%20is%20true%0A%20%20%20%20%2F%2FNOTE%20Caching%20is%20a%20good%20thing.%20Setting%20these%20to%20false%20is%20generally%20not%20advised.%20For%20more%20info%20on%20usage%20see%3A%20http%3A%2F%2Fcodex.wordpresorg%2FClass_Reference%2FWP_Query%23Permission_Parameters%0A%2F%2F%2F%2F%2F%2FSearch%20Parameter%0A%20%20%20%20’s’%20%3D%3E%20%24s%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(string)%20-%20Passes%20along%20the%20query%20string%20variable%20from%20a%20search.%20For%20example%20usage%20see%3A%20http%3A%2F%2Fwww.wprecipes.com%2Fhow-to-display-the-number-of-results-in-wordpress-search%20%0A%20%20%20%20’exact’%20%3D%3E%20true%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20-%20flag%20to%20make%20it%20only%20match%20whole%20titles%2Fposts%20-%20Default%20value%20is%20false.%20For%20more%20information%20see%3A%20https%3A%2F%2Fgist.github.com%2F2023628%23gistcomment-285118%0A%20%20%20%20’sentence’%20%3D%3E%20true%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F(bool)%20-%20flag%20to%20make%20it%20do%20a%20phrase%20search%20-%20Default%20value%20is%20false.%20For%20more%20information%20see%3A%20https%3A%2F%2Fgist.github.com%2F2023628%23gistcomment-285118%0A%2F%2F%2F%2F%2F%2FPost%20Field%20Parameters%0A%20%20%20%20%2F%2FNot%20sure%20what%20these%20do.%20For%20more%20info%20see%3A%20http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_Query%23Post_Field_Parameters%0A%2F%2F%2F%2F%2F%2FFilters%0A%20%20%20%20%2F%2FFor%20more%20information%20on%20available%20Filters%20see%3A%20http%3A%2F%2Fcodex.wordpress.org%2FClass_Reference%2FWP_Query%23Filters%0A)%3B%0A%24the_query%20%3D%20new%20WP_Query(%20%24args%20)%3B%0A%2F%2F%20The%20Loop%0Aif%20(%20%24the_query-%3Ehave_posts()%20)%20%3A%0Awhile%20(%20%24the_query-%3Ehave_posts()%20)%20%3A%20%24the_query-%3Ethe_post()%3B%0A%20%20%2F%2F%20Do%20Stuff%0Aendwhile%3B%0Aendif%3B%0A%2F%2F%20Reset%20Post%20Data%0Awp_reset_postdata()%3B%0A%3F%3E » message= » » highlight= » » provider= »manual »/]