{"id":41624,"date":"2023-08-14T13:23:58","date_gmt":"2023-08-14T13:23:58","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=tips-and-tricks&#038;p=41624"},"modified":"2023-08-14T13:35:24","modified_gmt":"2023-08-14T13:35:24","slug":"creating-new-badge-for-posts-published-within-last-n-days","status":"publish","type":"tips-and-tricks","link":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/","title":{"rendered":"Displaying \u201cNew\u201d Badge On Posts Published Within Last 5 Days"},"content":{"rendered":"\n<p>There are two ways of creating a Dynamic Visibility rule provided by the <em>JetEngine<\/em> plugin to show such a badge only on posts that were published within the last N days. Let it be 5 days in our example.<\/p>\n\n\n\n<p>This badge can be used in the Listing template for the needed post type or on the Single post page.\u00a0<\/p>\n\n\n\n<p>To learn how to create a Listing, proceed to the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetengine\/how-to-create-a-listing-template-for-post-types\/\"><strong>How to Create a Listing Template for Post Types in Elementor<\/strong><\/a> tutorial.<\/p>\n\n\n\n<p>To discover how to create a Single page, go to the <a href=\"https:\/\/crocoblock.com\/knowledge-base\/jetthemecore\/how-to-add-a-single-post-page-template-with-elementor\/\"><strong>How to Create a WordPress Single Post Page Template<\/strong><\/a> tutorial.<\/p>\n\n\n\n<p>Open a Lishing or Single Post page in the Elementor editor.<\/p>\n\n\n\n<p>The <strong>Heading<\/strong> or <strong>Text Editor<\/strong> widgets can be used for adding the needed text to be shown as a badge.<\/p>\n\n\n\n<div class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"365\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258.png\" alt=\"heading widget in the Elementor editor\" class=\"wp-image-41625\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258.png 837w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258-300x131.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258-768x335.png 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258-600x262.png 600w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-first-dynamic-visibility-rule-example-with-elementor-pro\">The First Dynamic Visibility Rule Example with Elementor Pro<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>Go to the <strong>Advanced <\/strong>settings tab of the widget and open the <strong>Dynamic Visibility <\/strong>tab.<\/p>\n\n\n\n<p>As a first example, the following Dynamic Visibility rule can be added.<\/p>\n\n\n\n<p>We <strong>enabled<\/strong> the toggle and selected the \u201cShow element if condition met\u201d <strong>Visibility condition type<\/strong> and the \u201cGreater than\u201d <strong>Condition<\/strong>.<\/p>\n\n\n\n<p>In the <strong>Field<\/strong>, click the <strong>coin stack icon<\/strong> and select the \u201cPost Date\u201d dynamic tag. In the \u201cPost Date\u201d <strong>settings<\/strong>, the <strong>Type<\/strong> should be set to \u201cPost Published,\u201d the <strong>Format<\/strong> needs to be \u201cCustom,\u201d and the <strong>Custom Format<\/strong> should be \u201cU,\u201d which stands for the Unix timestamp.\u00a0<\/p>\n\n\n\n<p>The post published date is required to be in the Unix timestamp to compare it with the value, which will be defined in the timestamp as well.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"356\" height=\"814\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_259.png\" alt=\"post date dynamic tag in the visibility condition\" class=\"wp-image-41626\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_259.png 356w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_259-131x300.png 131w\" sizes=\"(max-width: 356px) 100vw, 356px\" \/><\/div>\n\n\n\n<p>In the <strong>Value<\/strong> field, the \u201cMacros\u201d dynamic tag needs to be selected. From the<strong> Macros <\/strong>list, we picked the \u201cString to timestamp\u201d option, where the <strong>String to convert<\/strong> is \u201ctoday-5days.\u201d This value allows us to compare the post published date with a date within the range of the last 5 days and today.<\/p>\n\n\n\n<p>Lastly, the <strong>Data Type<\/strong> should be set to \u201cNumeric\u201d since the timestamp value is a number of seconds.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"358\" height=\"887\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_260.png\" alt=\"string to timestamp macro\" class=\"wp-image-41627\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_260.png 358w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_260-121x300.png 121w\" sizes=\"(max-width: 358px) 100vw, 358px\" \/><\/div>\n\n\n\n<p>Now, let us check the result of this Dynamic Visibility rule on the front end.<\/p>\n\n\n\n<p>A post has the 31.07.2023 (July 31st, 2023) published date. And we are writing these instructions on 02.08.2023 (August 2nd, 2023). This means the published date is within the range of the last 5 days to today, and the \u201cNew\u201d badge should be shown on the front end.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"462\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_262.png\" alt=\"post published date\" class=\"wp-image-41628\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_262.png 330w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_262-214x300.png 214w\" sizes=\"(max-width: 330px) 100vw, 330px\" \/><\/div>\n\n\n\n<p>When we check a post on its Single Post page on the front end, the badge is displayed correctly.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"428\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263-1024x428.png\" alt=\"bage on the single post page\" class=\"wp-image-41629\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263-1024x428.png 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263-300x125.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263-768x321.png 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263-600x251.png 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_263.png 1045w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div>\n\n\n\n<p>Let us also see another case when the badge is not supposed to be displayed.<\/p>\n\n\n\n<p>We edited the published date to be out of the date range set in the Dynamic Visibility <strong>Value<\/strong>. Let it be June 22nd, 2023.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"303\" height=\"231\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_264.png\" alt=\"editing post published date\" class=\"wp-image-41630\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_264.png 303w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_264-300x229.png 300w\" sizes=\"(max-width: 303px) 100vw, 303px\" \/><\/div>\n\n\n\n<p>And the badge is hidden on the front end, which is also correct according to the set published date and today\u2019s date.<\/p>\n\n\n\n<div class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"410\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265-1024x410.png\" alt=\"the badge is hidden\" class=\"wp-image-41631\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265-1024x410.png 1024w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265-300x120.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265-768x307.png 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265-600x240.png 600w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_265.png 1045w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-second-dynamic-visibility-rule-example-with-query-builder\">The Second Dynamic Visibility Rule Example with Query Builder<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\"><div class=\"wp-block-group__inner-container\">\n<p>The second way includes creating a custom query in the <em>JetEngine<\/em> Query Builder to check whether the current post on its Single page or in the Listing template has been published within the last 5 days to today.<\/p>\n\n\n\n<p>Proceed to the <strong><em>JetEngine > Query Builder<\/em><\/strong> tab and hit the <strong>\u201cAdd New\u201d <\/strong>button. <strong>Name <\/strong>the query and select the \u201cPost Query\u201d <strong>Query Type<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"711\" height=\"480\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_266.png\" alt=\"post query type\" class=\"wp-image-41632\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_266.png 711w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_266-300x203.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_266-600x405.png 600w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/div>\n\n\n\n<p>In the <strong>General <\/strong>tab, select the needed <strong>Post Type <\/strong>and <strong>Post Status<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"407\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_267.png\" alt=\"post type and post status\" class=\"wp-image-41633\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_267.png 814w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_267-300x150.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_267-768x384.png 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_267-600x300.png 600w\" sizes=\"(max-width: 814px) 100vw, 814px\" \/><\/div>\n\n\n\n<p>In the <strong>Post &amp; Page<\/strong> tab, click the <strong>coin-stack icon <\/strong>near the <strong>Post In<\/strong> field and select the \u201cCurrent ID\u201d macro. It means only the current post date will be checked by the query.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"379\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_268.png\" alt=\"current ID macro\" class=\"wp-image-41634\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_268.png 727w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_268-300x156.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_268-600x313.png 600w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/div>\n\n\n\n<p>Next, in the <strong>Date Query<\/strong> tab, we hit the <strong>\u201cAdd New\u201d <\/strong>button to add a <strong>Date Query Clauses<\/strong> and entered the \u2018today-5days\u2019 value in the <strong>After<\/strong> field. This will check whether the current post has been published within the last 5 days to today.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"835\" height=\"545\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_269.png\" alt=\"date query clause\" class=\"wp-image-41635\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_269.png 835w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_269-300x196.png 300w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_269-768x501.png 768w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_269-600x392.png 600w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/div>\n\n\n\n<p>The custom query is completed and can be saved by clicking the <strong>\u201cAdd\/Update Query\u201d <\/strong>button.<\/p>\n\n\n\n<p>We can return to the Listing or Single page in the Elementor editor and add a Dynamic Visibility rule to the \u201cNew\u201d badge.<\/p>\n\n\n\n<p>Go to the <strong>Advanced <\/strong>settings tab of the widget and open the <strong>Dynamic Visibility <\/strong>tab.<\/p>\n\n\n\n<p>We <strong>enabled<\/strong> the toggle and selected the \u201cShow element if condition met\u201d <strong>Visibility condition type<\/strong>, the \u201cQuery Has Item\u201d <strong>Condition<\/strong>, and the recently created query in the <strong>Query to check <\/strong>field.<\/p>\n\n\n\n<p>You can now click the <strong>\u201cUpdate\u201d <\/strong>button and check the result on the front end.<\/p>\n\n\n\n<div class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"623\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_270.png\" alt=\"query has item visibility condition\" class=\"wp-image-41636\" srcset=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_270.png 350w, https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_270-169x300.png 169w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/div>\n<\/div><\/div>\n\n\n\n<p>That is it. Now you know how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create JetEngine dynamic visibility rules for managing the visibility of widgets in a single post or listing template based on the post published date.<\/p>\n","protected":false},"author":8,"featured_media":0,"template":"","format":"standard","tipstricks-tags":[359],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock<\/title>\n<meta name=\"description\" content=\"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.\" \/>\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-new-badge-for-posts-published-within-last-n-days\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock\" \/>\n<meta property=\"og:description\" content=\"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-14T13:35:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258.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\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/\",\"name\":\"Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2023-08-14T13:23:58+00:00\",\"dateModified\":\"2023-08-14T13:35:24+00:00\",\"description\":\"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/#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\":\"Displaying \u201cNew\u201d Badge On Posts Published Within Last 5 Days\"}]},{\"@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":"Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock","description":"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.","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-new-badge-for-posts-published-within-last-n-days\/","og_locale":"en_US","og_type":"article","og_title":"Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock","og_description":"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/","og_site_name":"Help Center","article_modified_time":"2023-08-14T13:35:24+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2023\/08\/Screenshot_258.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\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/","url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/","name":"Displaying \u201cNew\u201d Badge On Posts Published N Days Ago | Crocoblock","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2023-08-14T13:23:58+00:00","dateModified":"2023-08-14T13:35:24+00:00","description":"Learn how to create JetEngine dynamic visibility rules and custom queries for managing the visibility of widgets in a single post or listing template based on the post published date.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/creating-new-badge-for-posts-published-within-last-n-days\/#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":"Displaying \u201cNew\u201d Badge On Posts Published Within Last 5 Days"}]},{"@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\/41624"}],"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=41624"}],"wp:term":[{"taxonomy":"tipstricks-tags","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tipstricks-tags?post=41624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}