Back to Forhad's Creations

Custom post type filter by taxonomy plugin for WordPress

By WP Forhad / September 26, 2024 / 3 discussion

CPT Filter Slider is a lightweight yet powerful WordPress plugin designed to help users filter and display custom post types (CPT) such as products, services, or other items in a user-friendly slider format. The plugin's main functionality is to filter items or products by category, enabling users to easily browse through specific items without the need for extensive page loads.

This plugin allows you to assign categories to items, and once a category is selected, only the items within that category are displayed, providing a smooth and efficient filtering experience. It is particularly useful for e-commerce websites or any WordPress site that needs to organize and present content in a structured, categorized manner.

Key Features:

  • Single-click category-based filtering for improved navigation
  • If there are more than eight items in a category it will work like a slider
  • Custom link button to navigate where you want 
  • Hover on items showing details is another great feature of this plugin.
  • Fully responsive design for optimal display on all devices
  • Quick and easy setup with minimal configuration needed

Use Case

The CPT Filter Slider plugin is versatile and can be used in a variety of scenarios where filtered content display is essential. Below are a few common use cases where the plugin excels:

E-commerce Website for Product Filtering

On an e-commerce website, you might have multiple categories like "Clothing," "Electronics," or "Home Goods." By using CPT Filter Slider, you can allow users to easily filter products by category. For instance, when a customer clicks on "Clothing," only the products in that category will be shown, making it easier for users to browse and find the items they want. This can enhance the shopping experience and potentially boost conversions.

E-Commerce-Product-Listing
E-Commerce Product Listing

Service Listings

For websites offering various services (e.g.,tools,  legal firms, consultants, or agencies), the plugin can be used to categorize and display services based on industry, expertise, or pricing. When visitors choose a specific category, they only see services that fit their needs, making the selection process faster and more intuitive.

Service Listing

Real Estate Listings

Real estate websites with multiple property types such as "Residential," "Commercial," or "Land" can leverage the CPT Filter Slider plugin. Visitors can filter properties by category and view only the listings that match their criteria, improving navigation and overall user experience on the site.

How to setup CPT Filter Slider WordPress plugin?

Step 01: First we have to go to the wordpress dashboard.

WP Dashboard

Step 02: Then we have to click the Plugins option from the dashboard. Then we have to click  “Add New Plugin” button  , from there we have to click “Upload Plugin”. Then we have to choose the plugin from our device. Then we have to click install button. Here we can Active The Plugin or we may active it later from Plugins options

Plugin Activation page

Step 03: After activation we will see a new option called “Tools” to our wordpress dashboard like below

Find Tools Option

Step 04: Then we have to go back to Tools options and add some categories as per our need.

Add Categories

Step 05: Now clicking on this Tools option we can add tool item by clicking on “Add New” Button. We can add a tool like below and customize it and publish it

Add Tool

Step 06: After Publishing we will see all the tools by categories on that page like below. If there are more than eight items in a category then we can slide the tools.

After publish Product showing

Note: This post doesn't have a single post view cause when we built it  there was no such requirement but if you need you can contact us.

Use our recommended page builder plugin, FancyPost to unlock a number of powerful blocks to help you to design amazing websites!

How to use Shortcode

Step 01:

  • Go to the WordPress dashboard and navigate to Pages or Posts.
  • Click Add New or edit an existing page where you want the filtered items to appear.

Step 02:

  • In the page or post editor, add the below shortcode wherever you want the slider to appear.
 [cpt-filter-slider]

Step 03:

  • Click Publish or Update to save your changes.
  • The slider will now display the items filtered by category on the front end of your site

More Screenshots

Basic customization

Customization

You can change title or category latter clicking on quick edit

Quick Edit Options

You can change everything latter clicking on edit

Edit Options

Live Demo

Click the button below to explore a live demo of the CPT Filter Slider plugin. Experience how easy it is to filter and display custom post types, such as products, services, or other items, in a sleek slider format. See the smooth filtering process by category and understand how the plugin can help you enhance browsing efficiency and user experience on your website.

Download

Ready to improve the way you display your custom post types? Click the button below to download the CPT Filter Slider plugin and start organizing and showcasing your content with an efficient filtering slider. Ideal for e-commerce websites or any site that needs structured content presentation, this plugin will make browsing fast and intuitive for your users.

Please enable JavaScript in your browser to complete this form.

Developer Area

The CPT to Category Filter & Slider plugin is built with flexibility in mind, making it easy for developers to extend or customize its functionality to suit specific needs. Below, you'll find resources and examples on how to integrate the plugin with custom code, use available hooks, filters, and more. 

1. Hooks and Filters

To help developers customize the plugin, we have included a variety of action hooks and filters. These can be used to modify the plugin’s output or behavior without directly modifying the core code, ensuring that your customizations remain intact after updates.

Available Hooks:

cpt_filter_slider_before: This action fires before the slider is rendered, allowing developers to inject custom content or functionality.
PHP

add_action('cpt_filter_slider_before', 'custom_function_before_slider');

 function custom_function_before_slider() {

    echo '<div>Custom HTML or code before slider</div>';

 }

cpt_filter_slider_after: This hook fires after the slider is rendered, ideal for adding additional content or elements after the slider.


add_action('cpt_filter_slider_after', 'custom_function_after_slider');

 function custom_function_after_slider() {

    echo '<div>Custom HTML or code after slider</div>';

 }

Available Filters:

cpt_filter_slider_query: Modify the query used to fetch the custom post types for the slider. This is useful if you want to adjust the query parameters such as filtering by additional taxonomies or modifying the number of items displayed.

add_filter('cpt_filter_slider_query', 'modify_slider_query');

 function modify_slider_query($query_args) {

    $query_args['posts_per_page'] = 10;

    return $query_args;

 }

cpt_filter_slider_output: Customize the output of each item in the slider.

add_filter('cpt_filter_slider_output', 'custom_slider_item_output');

function custom_slider_item_output($output, $post) {

    $output = '<div class="custom-slide">' . $post->post_title . '</div>';

    return $output;

}

2. Custom Code Examples

Here are some examples of how you can customize and extend the plugin:

Customizing the Slider Layout: Use the filter cpt_filter_slider_output to modify the HTML structure of the slider items. This is useful if you want to change the layout, add additional fields (like custom post meta), or modify the appearance.

add_filter('cpt_filter_slider_output', 'my_custom_slider_layout', 10, 2);

function my_custom_slider_layout($output, $post) {

    $custom_field = get_post_meta($post->ID, 'custom_field', true);

    $output = '<div class="slider-item">';

    $output .= '<h3>' . $post->post_title . '</h3>';

    $output .= '<p>' . $custom_field . '</p>';

    $output .= '</div>';

    return $output;

}

Modifying the Slider Query: Suppose you want to display only posts from a specific taxonomy, such as a custom category called “featured”. You can modify the query used by the shortcode as shown below.

add_filter('cpt_filter_slider_query', 'filter_featured_items');

function filter_featured_items($query_args) {

    $query_args['tax_query'] = array(

        array(

            'taxonomy' => 'category',

            'field' => 'slug',

            'terms' => 'featured',

        ),

    );

    return $query_args;

}

3. Extending the Plugin

For more advanced usage, developers can extend the plugin’s functionality by creating their own add-ons or integrating it with other tools and plugins. You can:

  • Create Custom Templates: Override the default template for the slider by creating custom templates in your theme. Simply copy the plugin’s template files into your theme’s folder and modify them as needed.
  • Integrate with Other Plugins: Use action hooks and filters to integrate the CPT to Category Filter & Slider plugin with other WordPress plugins like WooCommerce, Advanced Custom Fields (ACF), or Elementor.

4. Resources

  • Plugin API Documentation: [Link to API Docs]
  • GitHub Repository: [Link to GitHub Repo] – Access the source code and contribute to the plugin’s development.
  • Support and Community: Join the developer support forum to discuss issues, request features, or share your custom extensions with the community.

5. Getting Involved

We welcome contributions from developers! Whether you're fixing bugs, improving performance, or adding new features, your input is valuable. Feel free to submit pull requests on our GitHub page or contribute to discussions in the support forum.

Associate Plugins 

  • Duplicate Page By mndpsingh287

Search, install and active the Duplicate Page plugin By mndpsingh287 like below to make copy of similar types of item

Duplicate Plugin Installation
click this button to duplicate

Why Choose CPT to Category Filter & Slider?

While there are other plugins that offer filtering and post grid solutions, here’s why CPT to Category Filter & Slider stands out as the best option for displaying custom post types in a user-friendly and customizable slider format:

  • Simple Yet Powerful: Our plugin provides a straightforward way to filter custom post types by category, wrapped in an elegant slider layout. No complex configurations or additional plugins required.
  • Flexible Shortcode System: Easily embed the slider anywhere on your website using a simple shortcode, with the ability to customize it using parameters for full control over what gets displayed.
  • Seamless Integration: Whether you’re using standard post types or custom ones, our plugin integrates smoothly with WordPress without the need for additional tools or extensions.
  • Responsive and Mobile-Optimized: The slider is fully responsive, ensuring that your content looks great across all devices, from desktop to mobile, without compromising on performance or usability.
  • Developer-Friendly: We provide a wide range of hooks, filters, and API documentation, making it easy for developers to extend the plugin’s functionality or integrate it with other WordPress plugins.
  • Minimal Overhead: Unlike some feature-heavy plugins, ours is lightweight and optimized for performance, ensuring fast loading times without bloating your website.
  • Ongoing Support and Updates: We are committed to keeping the plugin up to date with new features and improvements. Plus, we offer dedicated support to help you get the most out of the plugin.

By choosing CPT to Category Filter & Slider, you get the perfect balance between ease of use and powerful features, making it an ideal solution for anyone looking to showcase their content in a filtered, category-based slider format.

Request for new features

We’re constantly working to improve the CPT to Category Filter & Slider plugin and make it the best solution for filtering and displaying custom post types. We value your feedback and ideas!

Do you have a feature you’d like to see added? Is there something that could make the plugin work even better for your specific needs?

How to Request a New Feature:

  • Submit Your Idea: Use our feature request form to share your thoughts on how we can enhance the plugin.
  • Vote on Existing Suggestions: Visit our public feedback board to see what other users have suggested and vote on features you find useful.
  • Join the Discussion: If you're a developer, you can also contribute to the conversation on our GitHub repository, where we actively discuss potential new features and improvements.

What Happens Next:

We carefully review all feature requests and community suggestions. Features that receive the most votes or align with our vision for the plugin may be added in future updates. You can also stay updated on the development process by checking our plugin roadmap.

Donate

If you’ve found the CPT to Category Filter & Slider plugin helpful and it has made your work easier, please consider making a donation.

Forhad Avatar

Hossain Muhammed Forhad

Forhad Hossain is the co-founder of Pluginic. He brings a one-of-a-kind fusion of tech brilliance, business savvy and marketing mojo to the table.

Forhad has consistently spearheaded the development of innovative products like Gutenic, Editorial Rating, FancyPost and many others that have become market leaders in their respective niches.

Website Builder Front Website Builder Back

Want To Build Better WordPress Websites?
Start Here! 👇

3
1 0 Rating
2 0 Rating
3 1 Rating
4 0 Rating
5 0 Rating
Total Vote: 1

Aggregate Rating System by Editorial Rating

3 responses to “Custom post type filter by taxonomy plugin for WordPress”

  1. Tellus etiam tincidunt erat neque ante ultricies nec litora porta faucibus risus mattis, pharetra id tempus est hendrerit congue nibh gravida vehicula facilisis.

Leave a Reply

Your email address will not be published. Required fields are marked *