{"id":8324,"date":"2019-06-03T09:43:23","date_gmt":"2019-06-03T09:43:23","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=8324"},"modified":"2023-01-23T14:44:16","modified_gmt":"2023-01-23T14:44:16","slug":"jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts","status":"publish","type":"article","link":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/","title":{"rendered":"How to Use Custom Query to Display Posts"},"content":{"rendered":"\n<p>We are presenting how to work with <a rel=\"noopener noreferrer\" href=\"https:\/\/crocoblock.com\/wp-query-generator\/\" target=\"_blank\">WP Query Generator<\/a> generating arguments for <strong>WP_Query class<\/strong> to present the posts according to the set query parameters using the Posts widget from JetElements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-a-custom-query-in-wp-query-generator\">Creating a custom query in WP Query Generator<\/h2>\n\n\n\n<p>First of all, we should open the <a rel=\"noopener noreferrer\" href=\"https:\/\/crocoblock.com\/wp-query-generator\/\" target=\"_blank\">WP Query Generator<\/a> tool and start setting the needed parameters for creating a custom query.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_64.png\" alt=\"WP Query Generator\" class=\"wp-image-8333\"\/><\/div>\n\n\n\n<ol>\n<li>We need to specify the <strong>Post Type<\/strong> slug, which is &#8220;post&#8221; in our case.<\/li>\n\n\n\n<li>In the <strong>Post status<\/strong> field, we can select what posts to display (such as &#8220;Publish&#8221;, &#8220;Pending&#8221;, &#8220;Draft&#8221;, etc.). We want to show published posts, so we have chosen the &#8220;Publish&#8221; option.<\/li>\n\n\n\n<li>Then we choose the &#8220;ASC&#8221; option in the <strong>Order<\/strong> drop-down list, so the queried posts will be showcased in ascending order.<\/li>\n\n\n\n<li>Last but not least, we specify the <strong>Order by<\/strong> parameter. If we select the &#8220;Name&#8221; option,  the posts will be sorted by their names.<\/li>\n<\/ol>\n\n\n\n<p>When all parameters are set, we can see the generated query below. It can be copied in JSON or PHP format. We click the &#8220;<strong>Copy to Clipboard<\/strong>&#8221; button and proceed with customizing the Posts widget in Elementor.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_65.png\" alt=\"WP Query Generator generated query\" class=\"wp-image-8334\"\/><\/div>\n\n\n\n<p>There are a lot of varied parameters, which can be set according to your needs and purposes. You can learn more about the provided parameters <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_Query\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adding-a-custom-query-to-the-posts-widget\">Adding a custom query to the Posts widget<\/h2>\n\n\n\n<p>In <strong>Elementor<\/strong> editor open the page, where you placed the Posts widget and click the &#8220;<strong>Edit Posts<\/strong>&#8221; button.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_66.png\" alt=\"Posts widget for Elementor\" class=\"wp-image-8335\"\/><\/div>\n\n\n\n<p>On the left, there is a panel with various settings for the widget. In the <strong>Content<\/strong> tab, find the <strong>Custom Query<\/strong> subsection and enable <strong>Use Custom Query<\/strong> toggle.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_67.png\" alt=\"Posts widget \" class=\"wp-image-8337\"\/><\/div>\n\n\n\n<p>After that, input the generated query in the field below.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_68.png\" alt=\"Posts widget custom query\" class=\"wp-image-8338\"\/><\/div>\n\n\n\n<p>Everything is done. Now the posts are displayed in the adjusted order using custom query method.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_69.png\" alt=\"Posts widget layout\" class=\"wp-image-8341\"\/><\/div>\n\n\n\n<p><br>Try to use a custom query in the <strong> JetElements Posts<\/strong> widget and you will be impressed by how useful and easy it is.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From this tutorial, you will learn how to create a custom query and add it to JetElements Posts widget to arrange posts in a certain order.<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","format":"standard","builder-category":[],"article-category":[517],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JetElements: How to Use Custom Query in Posts Widget | Crocoblock<\/title>\n<meta name=\"description\" content=\"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.\" \/>\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\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JetElements: How to Use Custom Query in Posts Widget | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-23T14:44:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_64.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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/\",\"name\":\"JetElements: How to Use Custom Query in Posts Widget | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2019-06-03T09:43:23+00:00\",\"dateModified\":\"2023-01-23T14:44:16+00:00\",\"description\":\"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-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 Custom Query to Display 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":"JetElements: How to Use Custom Query in Posts Widget | Crocoblock","description":"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.","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\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/","og_locale":"en_US","og_type":"article","og_title":"JetElements: How to Use Custom Query in Posts Widget | Crocoblock","og_description":"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/","og_site_name":"Help Center","article_modified_time":"2023-01-23T14:44:16+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2019\/05\/Screenshot_64.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/","url":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/","name":"JetElements: How to Use Custom Query in Posts Widget | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2019-06-03T09:43:23+00:00","dateModified":"2023-01-23T14:44:16+00:00","description":"Learn the guide on creating a custom query with WP Query Generator. Discover the opportunity to arrange your WordPress posts in a certain order.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-posts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/jetelements\/jetelements-posts-widget-how-to-use-custom-query-to-display-certain-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 Custom Query to Display 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\/8324"}],"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=8324"}],"wp:term":[{"taxonomy":"builder-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/builder-category?post=8324"},{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/article-category?post=8324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}