Documentation / Shortcodes

Shortcodes

The Filter Everything plugin supports five shortcodes that allow you to display Filters widget, Chips widget (Selected filters), Sorting widget, the Button that opens Filters widget on mobile devices and Number of found posts. Here they are [fe_widget], [fe_chips], [fe_sort], [fe_open_button], [fe_posts_found].

Filters widget

[fe_widget] – allows you to display the Filters widget wherever shortcodes are supported on your WordPress site – in posts content, pages content, widgets, in text blocks created with page builders, etc. Shortcode arguments allow you to change the widget properties.

Example

[fe_widget id="26" show_selected="yes" show_count="yes" horizontal="yes" columns="3"]

Arguments

  • title – widget title. Optional.
  • id – Filter Set ID you want to display. Note that this Filter Set must be located on this page. Optional. If you do not specify, the widget with highest priority will be displayed according to its order determined by the Order # parameter in the Filter Set.
  • show_selected – determines whether to display the selected terms (chips) at the top of the widget. Disabled by default.
  • show_count – determines whether to display the number of found posts at the top of the widget. Disabled by default.
  • horizontal – enables horizontal layout for the widget. Disabled by default.
  • columns – allows you to set columns count. From 2 to 5. Default value is 3.

Chips widget (Selected filters)

[fe_chips] – displays a list of selected terms and the “Reset all” button.

Example

[fe_chips id="36" mobile="yes" reset="no"]

Arguments

  • id – ID of the Filter Set whose selected terms you want to display. Optional parameter. If not specified, all selected terms of all Filter Widgets on the page will be displayed by default. Of course, the specified term must correspond to the Filter Set, which is located for this page.
  • mobile – determines whether to display chips on mobile devices. By default, chips are hidden on mobile devices.
  • reset – allows you to turn off the “Reset all” button and not display it. The button is displayed by default.

Note: if you need to remove existing chips, inserted automatically on WooCommerce pages, add please next code in the functions.php file of your theme or anywhere you can add PHP code.

remove_action('woocommerce_no_products_found', 'flrt_add_selected_terms_above_the_top');
remove_action('woocommerce_before_shop_loop', 'flrt_add_selected_terms_above_the_top', 5);

 

Sorting Widget

[fe_sort] – allows you to display Sorting Widget in desired places, where regular WordPress widgets are not available.

Example

[fe_sort id="3"]

Arguments

  • id – ID of the Sorting Widget.

How can I find widget id?

It’s a bit inconvenient, but to use this shortcode you must to create a WordPress widget first. Even it will be placed in the Inactive widgets area it will be enough for the shortcode work.

To find desired widget ID, you can insert the shortcode without id parameter, just [fe_sort] and to check the place, where it will be shown. You will see debug message, that shows you available Sorting Widget ID(s). For example “3” or “4” in our case.

Use the suggested ID in the shortcode to display desired widget.

 

Posts Found

[fe_posts_found] – outputs number of filtered posts.

Example

[fe_posts_found sid="419"]

Note: if you use AJAX, please make sure that you placed the shortcode inside the “HTML ID or Class of Posts Container“.

Arguments

  • sid – determines for what Filter Set to display filtered posts. Optional parameter. By default, the Filter Set with highest priority will be automatically detected. If the page contain one Filter Set, it will be used to calculate number of posts found.

 

Open button for Filters on mobile devices

[fe_open_button] – displays the Filters opening button on mobile devices. The button works with both Filters widget types: the Pop-up Filter widget and collapsible Filter widget which behavior is depending on the plugin settings.

Example

[fe_open_button id="77"]

Arguments

  • id – determines which Filter Set to open. Optional parameter. By default, the button will open Filter Set with highest priority if there are several of them on the page.

Make your filtering best with