Using Shortcodes for Dynamic AJAX Product Filters

The Dynamic AJAX Product Filters plugin allows you to easily integrate filters into your WordPress site using shortcodes. Here’s a comprehensive guide on how to use these shortcodes in various contexts.

General Shortcode Usage

Show All Filters Shortcode

  1. Show All Filters:
    • Use the shortcode plugincy_filters to display all available filters. This can be placed anywhere — in sidebars, on any page, in widgets, or within the customizer. It works with both free and pro versions of any WordPress theme.

Single Filter Shortcode

  1. Single Filter (Button Style):
    • To show a specific filter as a button style, use:
[plugincy_filters_single name="attribute_id"]

Replace "attribute_id" with the actual ID of the attribute you want to filter by.

Showing Selected Filters

  1. Currently Selected Filters (Chips Widget):
    • To display currently selected filters above the products, use:
[plugincy_filters_selected]

Place this shortcode above your product listings or anywhere you want to show the selected filters.

Using Shortcodes in Different Contexts

Use in Sidebar Process

  • To add filters to a sidebar:
    1. Go to Appearance > Widgets in your WordPress dashboard.
    2. Drag a Text or Custom HTML widget to the desired sidebar area.
    3. Paste the shortcode plugincy_filters or any specific filter shortcode inside the widget.
    4. Save the changes.

Use in Page Process

  • To include filters on a specific page:
    1. Edit the page where you want the filter to appear.
    2. In the content editor, simply paste the shortcode plugincy_filters or any specific filter shortcode.
    3. Update or publish the page.

Using PHP Code Process

  • To use shortcodes in theme files or custom PHP code:
    1. Open the PHP file where you want to add the filter (e.g., header.php, footer.php, or page.php).
    2. Use the following code to execute the shortcode:
<?php echo do_shortcode('[plugincy_filters]'); ?>

Replace plugincy_filters with any specific filter shortcode as needed & Save the file.

By using these shortcodes, you can seamlessly integrate the Dynamic AJAX Product Filters into your WordPress site, enhancing user experience and improving product navigation. Whether in sidebars, pages, widgets, or through PHP code, these filters are highly adaptable and easy to implement.