Live Filter – force to reload the page on click filter (to fix shortcode is visible in filter result and so on)

By default, the Live filter uses AJAX technique to load filter results. It means the page doesn’t 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 not executable) in the AJAX request.

To resolve this issue, please add this code to Custom JS field in Content Views >> Settings page:

/* Live Filter force to reload page */
window.cvp_lf_reload_url = true;

The page will reload, and shortcodes will be available and executable in the results.

Extra:

If you want to scroll back to the same position after reload, please add this code to Custom JS field in Content Views >> Settings page:

/* scroll back to the same section after reload */
$("input, select",".cvp-live-filter").on("change",function(){setTimeout(function(){window.cvp_lf_reload_url&&sessionStorage.setItem("cvp_offsettop",$(this).scrollTop())},100)}),$(window).on("load",function(){if($("input, select",".cvp-live-filter").length>0){var t=sessionStorage.getItem("cvp_offsettop");t&&$("html, body").animate({scrollTop:t},500)}});

Best regards,