{"id":1011,"date":"2021-06-18T11:55:19","date_gmt":"2021-06-18T11:55:19","guid":{"rendered":"https:\/\/crocoblock.com\/knowledge-base\/?post_type=article&#038;p=1011"},"modified":"2023-02-03T11:05:12","modified_gmt":"2023-02-03T11:05:12","slug":"cannot-output-the-most-popular-posts-via-listing-grid","status":"publish","type":"tips-and-tricks","link":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/","title":{"rendered":"Outputting the Most Popular Posts via Listing Grid and Order Them"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"data-store-configuration\">Data Store Configuration<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><div class=\"wp-block-group__inner-container\">\n<p>Make sure there is a <a href=\"https:\/\/youtu.be\/aP_jHmX9hd4?t=679\" target=\"_blank\" rel=\"noreferrer noopener\">created Data Store<\/a>, for example, <strong>Favorites<\/strong>, using the JetEngine functionalities. There is a need to show which posts the users liked the most and added them more often to their Favorites data store and then output the most popular posts in a Listing Grid in descending order.<\/p>\n\n\n\n<p>To make it all work smoothly, make sure to choose between these two <strong>Store types<\/strong> \u2013 \u201cCookies\u201d and \u201cSession\u201d. \u201cUser Metadata\u201d can backfire when the signup is not allowed, while \u201cLocal Storage\u201d is totally served by the browser, without the back-end, so it cannot be countable.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/favorites-data-store-types.png\" alt=\"possible store types for favorites datastore\">\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"order-posts-in-the-listing-grid-widget\">Order Posts in the Listing Grid Widget<\/h2>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\"><div class=\"wp-block-group__inner-container\">\n<p>Go to the website page, where you want to place the <strong>Listing Grid<\/strong>. Open this page in the Elementor page builder and find the <strong>Listing Grid<\/strong> widget in the left sidebar. Drag and drop it to the desired page area and select the Listing you\u2019ve just created in the <strong>Listing <\/strong>drop-down select.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configure-order-via-the-posts-query-section-in-the-listing-grid\">Configure order via the Posts Query section in the Listing Grid<\/h3>\n\n\n\n<p class=\"offset\">So far, the path to displaying the most liked posts from Data Stores in the Listing Grid is thorny. To make it happen, you are supposed to set up the <strong>Posts Query<\/strong> correctly.<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/posts-query-settings.png\" alt=\"listing grid posts query settings\">\n\n\n\n<p class=\"offset\">Add a new \u201corder &amp; offset\u201d query item and select the <strong>Order &amp; Offset<\/strong> query type. Go with DESC <strong>Order <\/strong>\u2013 this option will output the posts from the most liked ones to those least liked. In the <strong>Order by<\/strong> option, select \u201cMeta Value\u201d. Then paste the following into the <strong>Meta key to order<\/strong> field:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code offset\"><code>jet_engine_store_count_your-store-slug<\/code><\/pre>\n\n\n\n<p class=\"offset\">Where you need to replace <em>your-store-slug<\/em> with your actual Data Store slug. Just copy it from the JetEngine Dashboard.&nbsp;<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/favorites-data-store-slug.png\" alt=\"copying the favorites data store slug\">\n\n\n\n<p class=\"offset\">Lastly, you need to select the \u201cNUMERIC\u201d option in the <strong>Meta type<\/strong> drop-down. The final result should be looking like that:<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/ordered-posts.png\" alt=\"ordered popular posts\">\n\n\n\n<p>Save the changes by updating the page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"creating-custom-query-for-popular-posts-via-query-builder\">Creating Custom Query for popular posts via Query Builder<\/h3>\n\n\n\n<p>You can configure this very query item using JetEngine\u2019s separate module \u2013 <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/jetengine-query-builder-overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Query Builder<\/strong><\/a>.&nbsp;<\/p>\n\n\n\n<p>Go to <strong><em>JetEngine &gt; Query Builder &gt; Add New<\/em><\/strong>.<\/p>\n\n\n\n<p class=\"offset\">Name it and select the \u201cPosts Query\u201d option in the <strong>Query Type<\/strong> drop-down. Then set up the Posts Query settings. In the <strong>General <\/strong>tab, specify the <strong>Post Type<\/strong> and <strong>Post Status<\/strong>.&nbsp;&nbsp;<\/p>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/posts-query-setup-in-query-builder.png\" alt=\"posts query setup in query builder\">\n\n\n\n<p>Click on the \u201c<strong>Add new sorting parameter<\/strong>\u201d button and configure it as follows:<\/p>\n\n\n\n<ul>\n<li><strong>Order By<\/strong>. In this drop-down select, pick the \u201cOrder by numeric meta value\u201d option;<\/li>\n\n\n\n<li><strong>Meta key<\/strong>. Paste here <em>jet_engine_store_count_your-store-slug <\/em>just replace <em>your-store-slug<\/em> with an actual store slug;<\/li>\n\n\n\n<li><strong>Order<\/strong>. Select here the option called \u201cFrom highest to lowest values (3, 2, 1; c, b, a)\u201d.<\/li>\n<\/ul>\n\n\n\n<p>Press the \u201c<strong>Add Query<\/strong>\u201d button and proceed to <a href=\"https:\/\/crocoblock.com\/knowledge-base\/articles\/jetengine-query-builder-overview\/#title4\" target=\"_blank\" rel=\"noreferrer noopener\">display the query<\/a> on the page.<\/p>\n<\/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\"><b>1.<\/b> The only problem with such a setup is that the Listing will return only posts added into stores at least once, but this is due to the WP Query logic. This issue is to be resolved in the future.<br \/>\n<b>2.<\/b> This functionality is not fully protected from cheating. For example, the same user can like the same post from different browsers or devices, as well as under incognito mode. Each time a new count will be added to the Data Store stats.<\/p><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Find out how to display the posts that got more likes and order from the most to less popular ones. <\/p>\n","protected":false},"author":11,"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>Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting<\/title>\n<meta name=\"description\" content=\"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display &amp; order them in a Listing Grid.\" \/>\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\/cannot-output-the-most-popular-posts-via-listing-grid\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting\" \/>\n<meta property=\"og:description\" content=\"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display &amp; order them in a Listing Grid.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/\" \/>\n<meta property=\"og:site_name\" content=\"Help Center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-03T11:05:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/favorites-data-store-types.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=\"4 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\/cannot-output-the-most-popular-posts-via-listing-grid\/\",\"url\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/\",\"name\":\"Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting\",\"isPartOf\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/#website\"},\"datePublished\":\"2021-06-18T11:55:19+00:00\",\"dateModified\":\"2023-02-03T11:05:12+00:00\",\"description\":\"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display & order them in a Listing Grid.\",\"breadcrumb\":{\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/#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\":\"Outputting the Most Popular Posts via Listing Grid and Order Them\"}]},{\"@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":"Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting","description":"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display & order them in a Listing Grid.","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\/cannot-output-the-most-popular-posts-via-listing-grid\/","og_locale":"en_US","og_type":"article","og_title":"Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting","og_description":"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display & order them in a Listing Grid.","og_url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/","og_site_name":"Help Center","article_modified_time":"2023-02-03T11:05:12+00:00","og_image":[{"url":"https:\/\/crocoblock.com\/knowledge-base\/wp-content\/uploads\/2022\/09\/favorites-data-store-types.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/","url":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/","name":"Fail to Display Most Popular Posts in a Listing Grid | Troubleshooting","isPartOf":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/#website"},"datePublished":"2021-06-18T11:55:19+00:00","dateModified":"2023-02-03T11:05:12+00:00","description":"Having a Data Store? Learn how to query the posts that were added the most to user data stores, then display & order them in a Listing Grid.","breadcrumb":{"@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crocoblock.com\/knowledge-base\/tips-and-tricks\/cannot-output-the-most-popular-posts-via-listing-grid\/#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":"Outputting the Most Popular Posts via Listing Grid and Order Them"}]},{"@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\/1011"}],"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\/11"}],"wp:attachment":[{"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=1011"}],"wp:term":[{"taxonomy":"tipstricks-tags","embeddable":true,"href":"https:\/\/crocoblock.com\/knowledge-base\/wp-json\/wp\/v2\/tipstricks-tags?post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}