{"id":6458,"date":"2019-04-09T13:01:50","date_gmt":"2019-04-09T13:01:50","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=6458"},"modified":"2023-05-30T10:05:20","modified_gmt":"2023-05-30T10:05:20","slug":"how-to-use-wp-query-generator-to-query-the-posts","status":"publish","type":"article","link":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/","title":{"rendered":"How to Use WP Query Generator to Query the Posts"},"content":{"rendered":"\n<p>Here we are going to learn about <a href=\"https:\/\/crocoblock.com\/freemium\/tools\/wp-query-generator\/\" target=\"_blank\" rel=\"noopener noreferrer\">WP Query Generator<\/a> options and how they work. As you can see there are 9 tabs in the <strong>WP Query Generator<\/strong> tool so let\u2019s take an overview of each of them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"general-parameters\">General Parameters<\/h2>\n\n\n\n<p>This tab generates the code for ordering posts by following criteria:<\/p>\n\n\n\n<ul>\n<li><strong>post type<\/strong> (put the specific post\u2019s slug in this field);<\/li>\n\n\n\n<li><strong>post status<\/strong> (select the post\u2019s status e.g. draft, publish, private);<\/li>\n\n\n\n<li><strong>order<\/strong> (the ascending or the descending order);<\/li>\n\n\n\n<li><strong>order by<\/strong> (the parameter for posts ordering).<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-1.png\" alt=\"general parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pagination-parameters\">Pagination Parameters<\/h2>\n\n\n\n<p>This tab is a place where you can specify how the user will achieve the posts, how they will be separated into pages, how many posts should be skipped from being displayed. Here you can define the next information:<\/p>\n\n\n\n<ul>\n<li><strong>posts per page<\/strong> (the number of posts to show per page);<\/li>\n\n\n\n<li><strong>offset<\/strong> (hide the posts that already were shown);<\/li>\n\n\n\n<li><strong>paged<\/strong> (specify the pages where posts will be displayed);<\/li>\n\n\n\n<li><strong>page<\/strong> (the number of posts per static page);<\/li>\n\n\n\n<li><strong>ignore sticky posts<\/strong> (ignore posts stickiness while showing);<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-2.png\" alt=\"pagination parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"post-amp-page-parameters\">Post &amp; Page Parameters<\/h2>\n\n\n\n<p>This tab allows excluding or including some post and defining which parent pages are in list or not. Fill the next information to retrieve posts by:<\/p>\n\n\n\n<ul>\n<li><strong>post ID<\/strong> (the post&#8217;s ID);<\/li>\n\n\n\n<li><strong>post name<\/strong> (post\u2019s slug);<\/li>\n\n\n\n<li><strong>post title<\/strong> (the title of post);<\/li>\n\n\n\n<li><strong>page ID<\/strong> (the page&#8217;s ID);<\/li>\n\n\n\n<li><strong>page name<\/strong> (the title of page);<\/li>\n\n\n\n<li><strong>page parent<\/strong> (ID of parent page);<\/li>\n\n\n\n<li><strong>page parent in<\/strong> (ID of the parent page);<\/li>\n\n\n\n<li><strong>page parent not in<\/strong> (ID of the parent page);<\/li>\n\n\n\n<li><strong>post in<\/strong> (ID of the post that is included);<\/li>\n\n\n\n<li><strong>post not in<\/strong> (ID of the post that is excluded);<\/li>\n\n\n\n<li><strong>post name in<\/strong> (a slug of the post that is included).<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-3.png\" alt=\"post and page parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"author-parameters\">Author Parameters<\/h2>\n\n\n\n<p>This tab allows to query the posts by authors. All you need to do is to set the author\u2019s <strong>ID<\/strong> and <strong>Name<\/strong> in the following fields:<\/p>\n\n\n\n<ul>\n<li><strong>author<\/strong> (ID);<\/li>\n\n\n\n<li><strong>author name<\/strong> (use &#8220;user_its name&#8221; &#8211; NOT name).<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-4.png\" alt=\"author parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"category-amp-tag-parameters\">Category &amp; Tag Parameters<\/h2>\n\n\n\n<p>This tab allows displaying the posts by their tags and categories. You can also exclude the posts by category ID, slug, or the specific tags:<\/p>\n\n\n\n<ul>\n<li><strong>category<\/strong> (ID);<\/li>\n\n\n\n<li><strong>category name<\/strong> (slug);<\/li>\n\n\n\n<li><strong>category and<\/strong> (ID of the category to display);<\/li>\n\n\n\n<li><strong>category in<\/strong> (ID of the category to display);<\/li>\n\n\n\n<li><strong>category not in<\/strong> (ID of the category that is excluded);<\/li>\n\n\n\n<li><strong>tag<\/strong> (slug);<\/li>\n\n\n\n<li><strong>tag ID<\/strong> (ID);<\/li>\n\n\n\n<li><strong>tag and<\/strong> (ID of the tag to show);<\/li>\n\n\n\n<li><strong>tag in<\/strong> (ID of the tag to show);<\/li>\n\n\n\n<li><strong>tag not in<\/strong> (ID of the tag that is excluded);<\/li>\n\n\n\n<li><strong>tag slug and<\/strong> (slug of tag);<\/li>\n\n\n\n<li><strong>tag slug in<\/strong> (slug of tag).<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-5.png\" alt=\"category and tag parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tax-query-parameters\">Tax Query Parameters<\/h2>\n\n\n\n<p>This tab generates the posts query by custom taxonomy terms. To retrieve the needed posts use the specific taxonomy terms:<\/p>\n\n\n\n<ul>\n<li>click the <strong>Add New<\/strong> button to add an aditional query to apply together with the one already set.<\/li>\n<\/ul>\n\n\n\n<p>Note, that you can add as many queries as you need and then only set the relations between them.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-6.png\" alt=\"tax query parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"meta-query-parameters\">Meta Query Parameters<\/h2>\n\n\n\n<p>This tab allows displaying posts by meta key values. This query will come in handy if you want to showcase product post types and the prices:<\/p>\n\n\n\n<ul>\n<li>click <strong>Add New<\/strong> button in order to add an extra meta value field to set the query and select the relation beetwen them.<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-7.png\" alt=\"meta query parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"date-query-parameters\">Date Query Parameters<\/h2>\n\n\n\n<p>This tab allows creating a query for displaying posts that are published before or after the set date:<\/p>\n\n\n\n<ul>\n<li>click the <strong>Add New<\/strong> button and you get advanced settings (e.g. Year, Month, Week, etc.);<\/li>\n\n\n\n<li>you can add as many additional query as you wish and than apply the needed relation between them in the <strong>Relation<\/strong> dropdown.<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-8.png\" alt=\"date query parameters\">\n\n\n\n<h2 class=\"wp-block-heading\" id=\"misc-parameters\">Misc Parameters<\/h2>\n\n\n\n<p>This tab has five extended settings where you can:<\/p>\n\n\n\n<ul>\n<li>set password in the <strong>Has password <\/strong>field;<\/li>\n\n\n\n<li>if you decided to set the password for pulling out the post, type it in the <strong>Post password<\/strong> field;<\/li>\n\n\n\n<li>show only the posts that have the comments and define the excerpt for comments to display;<\/li>\n\n\n\n<li>you can also define if the posts will be displayed only for the users that have access to them in the <strong>User permission<\/strong> field;<\/li>\n\n\n\n<li>besides, you can define the post mime types for posts query.<\/li>\n<\/ul>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-9.png\" alt=\"misc parameters\">\n\n\n\n<p>After you have specified all features for posts query you will get the json code which you need to copy in the <strong>Generated Query<\/strong> section.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jkfgh-1.png\" alt=\"generated query section\">\n\n\n\n<p>Proceed to <strong>Posts<\/strong> widget&#8217;s settings, open the<strong> Content > General<\/strong> directory, enable the <strong>Use Custom Query<\/strong> option and paste the code in the empty field.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/01\/gdfh-1.png\" alt=\"custom query settings in posts widget\">\n\n\n\n<p>In case you are using <strong>Smart Posts List<\/strong>, navigate to the <strong>Content > Query &amp; Controls<\/strong>, turn on the <strong>Use Custom Query <\/strong>option and put the code in the empty field.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jkfgh-2.png\" alt=\"custom query settings in smart posts list widget\">\n","protected":false},"excerpt":{"rendered":"<p>This tutorial describes the way of working with one of Crocoblock&#8217;s development tools that helps you simplify the work of creating custom queries a bit.<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","format":"standard","builder-category":[],"article-category":[349,529],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use WP Query Generator | Crocoblock<\/title>\n<meta name=\"description\" content=\"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use WP Query Generator | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-30T10:05:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/\",\"name\":\"How to Use WP Query Generator | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2019-04-09T13:01:50+00:00\",\"dateModified\":\"2023-05-30T10:05:20+00:00\",\"description\":\"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/articles\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Use WP Query Generator to Query the Posts\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"name\":\"Help Center\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#organization\",\"name\":\"Help Center\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"contentUrl\":\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg\",\"caption\":\"Help Center\"},\"image\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use WP Query Generator | Crocoblock","description":"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/","og_locale":"en_US","og_type":"article","og_title":"How to Use WP Query Generator | Crocoblock","og_description":"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/","og_site_name":"Help Center","article_modified_time":"2023-05-30T10:05:20+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/02\/jbukjo-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/","url":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/","name":"How to Use WP Query Generator | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2019-04-09T13:01:50+00:00","dateModified":"2023-05-30T10:05:20+00:00","description":"Check the guidance of using a free tool from Crocoblock \u2014 WP Query Generator, and create your custom query to display the posts you want.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/articles\/how-to-use-wp-query-generator-to-query-the-posts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/crocoblock.com\/knowledge-base\/articles\/"},{"@type":"ListItem","position":3,"name":"How to Use WP Query Generator to Query the Posts"}]},{"@type":"WebSite","@id":"https:\/\/crocoblock.com\/knowledge-base\/#website","url":"https:\/\/crocoblock.com\/knowledge-base\/","name":"Help Center","description":"","publisher":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crocoblock.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/crocoblock.com\/knowledge-base\/#organization","name":"Help Center","url":"https:\/\/crocoblock.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","contentUrl":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/04\/invert-crocoblock-logo.svg","caption":"Help Center"},"image":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article\/6458"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/11"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=6458"}],"wp:term":[{"taxonomy":"builder-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/builder-category?post=6458"},{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article-category?post=6458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}