{"id":2885,"date":"2018-02-28T03:16:11","date_gmt":"2018-02-28T03:16:11","guid":{"rendered":"https:\/\/docs.contentviewspro.com\/?p=2885"},"modified":"2024-04-10T02:33:05","modified_gmt":"2024-04-10T02:33:05","password":"","slug":"live-filter-hide-posts-beginning","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/live-filter-hide-posts-beginning\/","title":{"rendered":"Live Filter \u2013 hide all posts at the beginning"},"content":{"rendered":"<p>By default, posts will be visible under filters list of Live Filter.<br \/>\nTo hide these posts at page load, Please add this code to Custom JS field in Content Views &gt;&gt; Settings page:<\/p>\n<pre style=\"font-size: 13px;\">\/* Live Filter \u2013 Hide results at beginning *\/\nvar view_id=\"<strong>VIEW_ID<\/strong>\",$view=$(\"#pt-cv-view-\"+view_id),$pagination=$(\".pt-cv-pagination-wrapper [data-sid=\"+view_id+\"]\").parent();new RegExp($(\".cvp-live-filter\").map(function(){return $(this).data(\"name\")}).get().join(\"|\")).test(window.location.search)||($view.hide(),$pagination.hide());\n<\/pre>\n<p>Please replace <strong>VIEW_ID<\/strong> with <a href=\"https:\/\/contentviewspro.com\/documentation\/article\/what-is-id-of-a-view\/\">ID of your View<\/a>. Also, ensure there is NO space between quotes.<\/p>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, posts will be visible under filters list of Live Filter. To hide these posts at page load, Please add this code to Custom JS field in Content Views &gt;&gt; Settings page: \/* Live Filter \u2013 Hide results at beginning *\/ var view_id=&#8221;VIEW_ID&#8221;,$view=$(&#8220;#pt-cv-view-&#8220;+view_id),$pagination=$(&#8220;.pt-cv-pagination-wrapper [data-sid=&#8221;+view_id+&#8221;]&#8221;).parent();new RegExp($(&#8220;.cvp-live-filter&#8221;).map(function(){return $(this).data(&#8220;name&#8221;)}).get().join(&#8220;|&#8221;)).test(window.location.search)||($view.hide(),$pagination.hide()); Please replace VIEW_ID with ID of your View. &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/live-filter-hide-posts-beginning\/\"> <span class=\"screen-reader-text\">Live Filter \u2013 hide all posts at the beginning<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[46],"doc_tag":[36,35],"class_list":["post-2885","docs","type-docs","status-publish","hentry","doc_category-live-filter","doc_tag-custom-js","doc_tag-live-filter"],"year_month":"2026-09","word_count":93,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"CVP","author_nicename":"cvp","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/cvp\/"},"doc_category_info":[{"term_name":"Live Filter (Frontend Search &amp; Filter)","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/live-filter\/"}],"doc_tag_info":[{"term_name":"custom JS","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-js\/"},{"term_name":"live filter","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/live-filter\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=2885"}],"version-history":[{"count":3,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2885\/revisions"}],"predecessor-version":[{"id":5903,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2885\/revisions\/5903"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2885"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2885"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}