{"id":2257,"date":"2017-08-10T04:24:21","date_gmt":"2017-08-10T04:24:21","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=2257"},"modified":"2023-12-27T10:45:03","modified_gmt":"2023-12-27T10:45:03","password":"","slug":"shuffle-filter-set-default-filter-activate-a-filter-at-beginning","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/shuffle-filter-set-default-filter-activate-a-filter-at-beginning\/","title":{"rendered":"Shuffle Filter &#8211; set default filter (activate a filter at beginning)"},"content":{"rendered":"<p>By default, the &#8220;All&#8221; option is active in Shuffle Filter.<br \/>\nTo activate another filter at beginning, please add this code to <strong>Custom JS<\/strong> field in Content Views >> Settings page:<\/p>\n<pre style=\"font-size:13px\">\n\/* Shuffle Filter - set default filter *\/\nwindow.sf_enable_trigger = true;\nsetTimeout(function() {\n    var $filter_bar = $('[id^=\"pt-cv-filter-bar-VIEWID\"]');\n    $filter_bar.find('.pt-cv-filter-option').eq(1).trigger('click');\n}, 2000);\n<\/pre>\n<p>Please replace <strong>VIEWID<\/strong> with ID of your View, and replace <strong>the number 1<\/strong> with index number of the filter you want to activate. Here are indexes of filters:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/09\/shuffle-index.png\" alt=\"\" width=\"566\" height=\"114\" class=\"alignnone size-full wp-image-2260\" srcset=\"https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/09\/shuffle-index.png 566w, https:\/\/contentviewspro.com\/documentation\/wp-content\/uploads\/2017\/09\/shuffle-index-300x60.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/p>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the &#8220;All&#8221; option is active in Shuffle Filter. To activate another filter at beginning, please add this code to Custom JS field in Content Views >> Settings page: \/* Shuffle Filter &#8211; set default filter *\/ window.sf_enable_trigger = true; setTimeout(function() { var $filter_bar = $(&#8216;[id^=&#8221;pt-cv-filter-bar-VIEWID&#8221;]&#8217;); $filter_bar.find(&#8216;.pt-cv-filter-option&#8217;).eq(1).trigger(&#8216;click&#8217;); }, 2000); Please replace VIEWID with ID &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/shuffle-filter-set-default-filter-activate-a-filter-at-beginning\/\"> <span class=\"screen-reader-text\">Shuffle Filter &#8211; set default filter (activate a filter at 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":[53],"doc_tag":[33],"class_list":["post-2257","docs","type-docs","status-publish","hentry","doc_category-shuffle-filter","doc_tag-shuffle-filter"],"year_month":"2026-09","word_count":86,"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":"Shuffle Filter","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/shuffle-filter\/"}],"doc_tag_info":[{"term_name":"shuffle filter","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/shuffle-filter\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2257","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=2257"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2257\/revisions"}],"predecessor-version":[{"id":5428,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2257\/revisions\/5428"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2257"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2257"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}