{"id":2322,"date":"2017-10-11T03:05:41","date_gmt":"2017-10-11T03:05:41","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=2322"},"modified":"2025-01-20T04:06:52","modified_gmt":"2025-01-20T04:06:52","password":"","slug":"live-filter-shortcode-is-visible-in-filter-result","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/live-filter-shortcode-is-visible-in-filter-result\/","title":{"rendered":"Live Filter &#8211; force to reload\/refresh on changing filter"},"content":{"rendered":"<p>By default, the Live filter uses AJAX technique to load filter results. It means the page doesn\u2019t reload, and an asynchronous request is sent to the webserver to retrieve the result.<br \/>\nIf the shortcodes of the theme or another plugin are visible in the retrieved result, the reason is these shortcodes are not available (and not executable) in the AJAX request.<\/p>\n<p>To resolve this issue, please add this code to <strong>Custom JS<\/strong> field in Content Views &gt;&gt; Settings page:<\/p>\n<pre style=\"font-size: 13px;\">\/* Live Filter force to reload page *\/\nwindow.cvp_lf_reload_url = true;\n<\/pre>\n<p>The page will reload, and shortcodes will be available and executable in the results.<\/p>\n<h3 id=\"scrollback\">Extra:<\/h3>\n<p>If you want to <strong>scroll back to the same position after reload<\/strong>, please add this code to <strong>Custom JS<\/strong> field in Content Views &gt;&gt; Settings page:<\/p>\n<pre style=\"font-size: 13px;\">\n\/* Live Filter - scroll back to the same section after reload *\/\n$(\"input, select\",\".cvp-live-filter\").on(\"change\",function(){setTimeout(function(t){(window.cvp_lf_reload_url||0===t.closest(\".pt-cv-wrapper\").find(\".pt-cv-view\").length)&&sessionStorage.setItem(\"cvp_offsettop_\"+t.closest(\".cvp-live-filter\").data(\"sid\"),$(this).scrollTop())},100,$(this))}),$(function(){if($(\"input, select\",\".cvp-live-filter\").length>0){var t=$(\"input, select\",\".cvp-live-filter\").first().closest(\".cvp-live-filter\").data(\"sid\"),e=sessionStorage.getItem(\"cvp_offsettop_\"+t);e&&$(\"html, body\").animate({scrollTop:e},500),e&&sessionStorage.removeItem(\"cvp_offsettop_\"+t)}});\n<\/pre>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the Live filter uses AJAX technique to load filter results. It means the page doesn\u2019t reload, and an asynchronous request is sent to the webserver to retrieve the result. If the shortcodes of the theme or another plugin are visible in the retrieved result, the reason is these shortcodes are not available (and &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/live-filter-shortcode-is-visible-in-filter-result\/\"> <span class=\"screen-reader-text\">Live Filter &#8211; force to reload\/refresh on changing filter<\/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-2322","docs","type-docs","status-publish","hentry","doc_category-live-filter","doc_tag-custom-js","doc_tag-live-filter"],"year_month":"2026-09","word_count":214,"total_views":"3","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\/2322","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=2322"}],"version-history":[{"count":3,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2322\/revisions"}],"predecessor-version":[{"id":6022,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/2322\/revisions\/6022"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=2322"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=2322"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}