{"id":46898,"date":"2025-01-29T14:31:03","date_gmt":"2025-01-29T14:31:03","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=tips-and-tricks&#038;p=46898"},"modified":"2025-01-29T14:32:01","modified_gmt":"2025-01-29T14:32:01","slug":"creating-filter-to-display-all-and-latest-posts-from-last-two-weeks","status":"publish","type":"tips-and-tricks","link":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/","title":{"rendered":"Creating a Filter to Display All and Latest Posts from the Last Two Weeks"},"content":{"rendered":"<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">For this tutorial, we used the <a href=\"https:\/\/crocoblock.com\/dynamic-templates\/balirento\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Balirento<\/strong> dynamic template<\/a>.<\/p><\/div><\/div>\n\n\n\n<p>The \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/filters-data-source-overview\/#jetengine-query-builder-switcher-source\" target=\"_blank\" rel=\"noreferrer noopener\">JetEngine Query Builder Switcher<\/a>\u201d <strong>Data Source <\/strong>type enables the switching of <em>JetEngine<\/em> <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/query-builder-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\">custom queries<\/a> directly from the front end.<\/p>\n\n\n\n<p>This source<strong> <\/strong>is available in the \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/jetsmartfilters-how-to-use-the-select-filter-to-filter-publications-or-products\/\" target=\"_blank\" rel=\"noreferrer noopener\">Select<\/a>\u201d and \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/radio-filter-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\">Radio<\/a>\u201d<strong> <\/strong>filters\u2019 settings and requires the <em>JetEngine <\/em>plugin of 3.2.0 version and higher to be activated.<\/p>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">The \u201cJetEngine Query Builder Switcher\u201d <strong>Data Source<\/strong> is not supported by the \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/jetsmartfilters-how-to-create-a-new-filter-and-apply-it-to-publications\/\" target=\"_blank\" rel=\"noreferrer noopener\">Checkboxes list<\/a>\u201d <strong>Filter Type<\/strong>.<\/p><\/div><\/div>\n\n\n\n<p>In this tutorial&#8217;s use case, the goal is to display a list of posts on a page. When a filter is applied, only the most recent posts\u2014created within the last two weeks\u2014should be shown.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-two-posts-queries\">Create Two Posts Queries<\/h2>\n\n\n\n<p>For our purpose, two \u201c<a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/query-builder-posts-query-type\/\" target=\"_blank\" rel=\"noreferrer noopener\">Posts Queries<\/a>\u201d should be created.<\/p>\n\n\n\n<p>Go to <strong><em>WordPress Dashboard &gt; JetEngine &gt; Query Builder <\/em><\/strong>and press the \u201c<strong>Add New<\/strong>\u201d button.<\/p>\n\n\n\n<p>The first \u201cPosts Query\u201d will list all posts, so we name it \u201cAll Posts.\u201d<\/p>\n\n\n\n<p>In each custom query, a <strong>Query ID <\/strong>should be defined, and it<strong> <\/strong>should be the same in both queries.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id.webp\" alt=\"jetsmartfilters posts query id\" class=\"wp-image-46900\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">It is highly recommended that a <strong>Query ID<\/strong> be applied to the switched custom queries. Otherwise, if multiple widgets\/blocks\/elements of the same provider are on the page, the filter will be applied to all of them. To prevent this from happening, all custom queries used in the filter should be given the same <strong>Query ID<\/strong>, which should later be pasted into the <strong>Query ID<\/strong> setting in the filter widget\/block\/element and the <strong>CSS ID<\/strong> field of the provider.<\/p><\/div><\/div>\n\n\n\n<p>In the <strong>Posts Query <\/strong>section, <strong>General<\/strong> tab, specify the <strong>Post Type <\/strong>if needed. It can be one or several; for our case, we set \u201cPosts.\u201d<\/p>\n\n\n\n<p>For the first query, that\u2019s all for the customization, so press the \u201c<strong>Add Query<\/strong>\u201d button.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1.webp\" alt=\"posts query general settings\" class=\"wp-image-46902\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/posts-query-general-settings-1-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>Return to the <strong><em>WordPress Dashboard &gt; JetEngine &gt; Query Builder <\/em><\/strong>tab and push the \u201c<strong>Add New<\/strong>\u201d button again.<\/p>\n\n\n\n<p>The second \u201cPosts Query\u201d<strong> <\/strong>will list only posts created in the last two weeks, so it\u2019s named \u201cLatest posts.\u201d&nbsp;<\/p>\n\n\n\n<p>Set the same <strong>Query ID <\/strong>as for the first query.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query.webp\" alt=\"latest posts custom query\" class=\"wp-image-46901\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/latest-posts-custom-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>Scroll down to the <strong>Posts Query <\/strong>section, and, in the <strong>General <\/strong>tab, set the same <strong>Post Type<\/strong> as for the first query.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings.webp\" alt=\"jetengine posts query general settings\" class=\"wp-image-46906\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-posts-query-general-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>Then, open the <strong>Date Query <\/strong>tab and hit the \u201c<strong>Add new<\/strong>\u201d button. Into the <strong>After <\/strong>field, enter \u201c2 weeks ago\u201d.<\/p>\n\n\n\n<p>After that, you can click the \u201c<strong>Add Query<\/strong>\u201d button to save the settings.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query.webp\" alt=\"date query clause for the posts query\" class=\"wp-image-46903\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/date-query-clause-for-the-posts-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-filter\">Create a Filter<\/h2>\n\n\n\n<p>Once the queries are created, head to <strong><em>WordPress Dashboard &gt; Smart Filters &gt; Add New<\/em><\/strong>. Enter the <strong>Filter Name <\/strong>and pick the <strong>Filter Type <\/strong>(\u201cSelect\u201d in this case).<\/p>\n\n\n\n<p>Choose the \u201cJetEngine Query Builder Switcher\u201d <strong>Data Source<\/strong>. In the <strong>Select Query <\/strong>dropdown, set the two just-created queries.<\/p>\n\n\n\n<p>Click the \u201c<strong>database<\/strong>\u201d icon next to the <strong>Query Variable <\/strong>field and pick the \u201cSwitch JetEngine query\u201d option.<\/p>\n\n\n\n<p>Adjust other filter settings if required and push the \u201c<strong>Update<\/strong>\u201d button.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings.webp\" alt=\"filter with jetengine query builder switcher settings\" class=\"wp-image-46904\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-with-jetengine-query-builder-switcher-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"place-the-filter-and-its-provider-on-a-page\">Place the Filter and Its Provider on a Page<\/h2>\n\n\n\n<p>Now, it is time to display the items on the website. It can be done with a <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/listing-grid-widget-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Listing Grid<\/strong><\/a><strong> <\/strong>widget\/block\/element so that a <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-create-a-listing-template-for-post-types\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Listing Template<\/strong><\/a> should be built beforehand. You can check other <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetsmartfilters\/filters-providers-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>filter providers<\/strong><\/a> to select the most suitable one.<\/p>\n\n\n\n<p>The <strong>Listing Grid <\/strong>and <strong>Select Filter <\/strong>should be placed on the needed page or template in the Elementor, WordPress block, or Bricks editor. In the <strong>Listing Grid <\/strong>settings, pick the created <strong>Listing<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings.webp\" alt=\"etengine listing grid settings\" class=\"wp-image-46905\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetengine-listing-grid-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>Unroll the <strong>Custom Query <\/strong>tab of the <strong>Listing Grid<\/strong>, activate the <strong>Use Custom Query<\/strong> toggle, and set the \u201cAll Posts\u201d <strong>Custom Query<\/strong>. In this way, the listing will initially display all posts.<\/p>\n\n\n\n<div class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query.webp\" alt=\"listing grid with all posts custom query\" class=\"wp-image-46907\" style=\"width:840px;height:auto\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-with-all-posts-custom-query-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">Applying a custom query to the filtered provider is obligatory. If the <strong>Listing Template<\/strong> was already based on the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/features\/listing-template-in-elementor-overview\/#query-builder\" target=\"_blank\" rel=\"noreferrer noopener\">\u201cQuery Builder\u201d source<\/a>, applying the custom query in the settings of the filtered provider is not needed.<\/p><\/div><\/div>\n\n\n<div class=\"note-banner d-flex border-bold border-jetthemecore rounded overflow-hidden p-20\"><div class=\"mr-12\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M9 21C9 21.5 9.4 22 10 22H14C14.6 22 15 21.5 15 21V20H9V21ZM12 2C8.1 2 5 5.1 5 9C5 11.4 6.2 13.5 8 14.7V17C8 17.5 8.4 18 9 18H15C15.6 18 16 17.5 16 17V14.7C17.8 13.4 19 11.3 19 9C19 5.1 15.9 2 12 2Z\" fill=\"#F2D23C\"\/><\/svg><\/div><div class=\"d-flex flex-column\"><div class=\"text-900 mb-12\">Things to know<\/div><p class=\"m-0\">Be aware that the custom query settings take over the <strong>Posts number <\/strong>option of the <strong>Listing Grid<\/strong>. To display the exact number of posts per page, you can adjust the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/query-builder-posts-query-type\/#pagination\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Pagination<\/strong><\/a><strong> <\/strong>settings of the \u201cPosts Query.\u201d<\/p><\/div><\/div>\n\n\n\n<p>Also, the <strong>Query ID <\/strong>from the custom queries settings should be copied and pasted into the <strong>CSS ID <\/strong>field of the <strong>Advanced<\/strong> tab of the <strong>Listing Grid <\/strong>settings.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id.webp\" alt=\"listing grid advanced settings css id\" class=\"wp-image-46908\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/listing-grid-advanced-settings-css-id-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>In the <strong>Select Filter <\/strong>settings, the created filter should be picked, the <strong>This filter for <\/strong>set to \u201cJetEngine\u201d (because the \u201cJetEngine\u201d provider stands for the<strong> Listing Grid<\/strong>),and the <strong>Query ID <\/strong>pasted.<\/p>\n\n\n\n<div class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings.webp\" alt=\"select filter settings\" class=\"wp-image-46909\" style=\"width:840px;height:auto\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/select-filter-settings-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>Customize the page or template as needed and save it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"check-the-result\">Check the Result<\/h2>\n\n\n\n<p>Now, the filter is ready for use. Open the page on the front end to test how it works.&nbsp;<\/p>\n\n\n\n<p>When selecting the \u201cLatest posts\u201d option, the listing displays only the posts created in the last two weeks.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><a href=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"1824\" height=\"1100\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks.webp\" alt=\"filter shows the posts published from the last two weeks\" class=\"wp-image-46910\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks.webp 1824w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks-300x181.webp 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks-1024x618.webp 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks-768x463.webp 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks-1536x926.webp 1536w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/filter-shows-the-posts-published-from-the-last-two-weeks-600x362.webp 600w\" sizes=\"(max-width: 1824px) 100vw, 1824px\" \/><\/a><\/div>\n\n\n\n<p>That\u2019s all. Now you know how to use the \u201cJetEngine Query Builder Switcher\u201d <strong>Data Source<\/strong> to create a <em>JetSmartFilters<\/em> filter to display all the latest posts from the last two weeks on your WordPress website.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all and the latest posts from the last two weeks.<\/p>\n","protected":false},"author":8,"featured_media":0,"template":"","format":"standard","tipstricks-tags":[360],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock<\/title>\n<meta name=\"description\" content=\"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.\" \/>\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\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-29T14:32:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id.webp\" \/>\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\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/\",\"name\":\"Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2025-01-29T14:31:03+00:00\",\"dateModified\":\"2025-01-29T14:32:01+00:00\",\"description\":\"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips & tricks\",\"item\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating a Filter to Display All and Latest Posts from the Last Two Weeks\"}]},{\"@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":"Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock","description":"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.","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\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/","og_locale":"en_US","og_type":"article","og_title":"Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock","og_description":"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/","og_site_name":"Help Center","article_modified_time":"2025-01-29T14:32:01+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2025\/01\/jetsmartfilters-posts-query-id.webp"}],"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\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/","url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/","name":"Creating a Filter to Display All and Latest Posts from the Last Two Weeks \u2014 JetSmartFilters | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2025-01-29T14:31:03+00:00","dateModified":"2025-01-29T14:32:01+00:00","description":"This tutorial explains how to use the \u201cJetEngine Query Builder Switcher\u201d Data Source to create a JetSmartFilters filter to display all the latest posts from the last two weeks.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-filter-to-display-all-and-latest-posts-from-last-two-weeks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crocoblock.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"Tips & tricks","item":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/"},{"@type":"ListItem","position":3,"name":"Creating a Filter to Display All and Latest Posts from the Last Two Weeks"}]},{"@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\/tips-and-tricks\/46898"}],"collection":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tips-and-tricks"}],"about":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/types\/tips-and-tricks"}],"author":[{"embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/users\/8"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=46898"}],"wp:term":[{"taxonomy":"tipstricks-tags","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tipstricks-tags?post=46898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}