Enabling “Filters” button on non-filterable pages

By default the “Filters” toggle button has been designed to work only on filterable pages, such as shop, WooCommerce product category archives, attributes archives, pages with registered filterable shortcodes etc. Below you will find the procedure that will help overcome this limitation.

Disclaimer: while all the basic options of togglable presets have been reported to work in setups that override the default “Filters” button functionality, keep in mind that some filter options may not be supported on non-filterable pages. Please test the work of the overridden presets thoroughly.

To enable the work of the “Filters” toggle button on non-filterable pages follow the steps below.

  1. Go to the settings of the preset that you wish to display on non-filterable pages, and make sure that:
    • Its Visibility is set to be Controlled by “Filters” button
    • The pages where you wish to place the button are covered by the Display on section of the preset settings. You can set it to All pages to enable the button for all the pages of your site.
  2. To register the insertion point for the “Filters” button, use one of the 2 techniques:
    • Insert the [annasta_filters_toggle_button] shortcode into any suitable page element that is present and visible on all the pages where you wish to display the button.

      OR
    • Set the annasta Filters > Plugin settings > “Filters” toggle button settings > Position before custom selector field to the needed selector that is present on all the pages where you need to display the button.
  3. Go to annasta Filters > Plugin settings section of your WP admin and add the following snippet into the Custom JavaScript box:
jQuery( document ).on( 'awf_after_setup', function( $ ) {
if( 'redirect_ajax' in awf_data ) {
a_w_f.setup_togglable_preset();
}
});