MP3 Audio Player
Documentation
Search for articles about the Audio Player and WordPress Theme
Table of contents

How to use Filters Widget using ACF

Filters can help your audience easily navigate and find the audio they want. In this step-by-step guide, we’ll show you how to create a new filter category and add options to it, then seamlessly integrate it into your audio player for a better user experience.

Understanding Posts and Filtering

In WordPress, content is organized into “posts.” This includes everything from blog articles, playlist post, products to individual tracks in your playlist. The MP3 Audio Player Pro utilizes this structure to manage and display your audio content. To leverage WordPress’s filtering capabilities effectively, it’s crucial to organize your audio tracks appropriately.

One Track Per Post!

Assigning one track per post is more than just a recommendation—it’s a strategy for making the most out of WordPress’s filtering system. When you filter content on your site, you’re actually filtering posts based on their attributes, like categories, tags, and custom fields.

This approach ensures that you’re effectively filtering posts according to specific attributes (e.g., categories, tags, custom fields, etc.). Our player is designed to aggregate and display multiple “posts.” For instance, if your site hosts 10 different posts, each with one track, the player will showcase those 10 tracks. Conversely, if you have 1 post containing 10 tracks, the player will display a total of 10 tracks. However, filtering might not work as expected because WordPress’s filtering system is designed to work at the post level, not on individual tracks within posts.

How to create filters in WordPress using ACF?

First, you’ll need to create custom fields that you will use in your posts later. Navigate to WP-Admin > ACF > Field Groups. From there, you can add or edit groups of custom fields.

Create Custom Fields:

  1. Navigate to WP-Admin > ACF > Field Groups.
  2. Click Add New to create a new field group or select an existing one.
  3. Add fields that will serve as filter criteria (e.g., Genre, Mood, Instrument, BPM).
    • Make sure that field types are either Number, Select, or Checkbox.

Assign those Group Fields to your desired Post Types:

One very important thing that many people forget is to set the correct Location Rules so those filters actually display when you edit a post.

  1. Under Location Rules, assign these fields to the desired post types (e.g., Playlist, Products, Posts, other Custom Post Types, etc..).
  2. Save your changes.

How to use our filter widgets ?

The video below shows you how to create custom fields with ACF, and how to use filters in the player.

Frequently Asked Questions #

Q: Where can i find the player ID’s for the filters?
A: You can set an ID on the player widget here: https://drops.sonaar.io/i/jGH86v

Q: Can I filter track’s metadata or ID3 Tags ?
A: It’s important to understand that track metadata cannot be filtered straight out of the box. You can only filter based on the post’s custom fields, categories or tags.

We recommend using the plugin ACF (Advanced Custom Fields) to create these fields and not rely on the track’s ID3 tags. Filtering based on track metadata is not feasible due to the sheer volume of tracks and potential inconsistencies in metadata, such as slight variations in artist names. This limitation is in place to maintain performance and user experience.

Q: Wait, I have more than 100 tracks! Do I have to create 100 individual posts manually ?
A:Fortunately, the answer is no. You can streamline the process by using the PLAYLIST BULK IMPORTER, accessible via WP-Admin > MP3 Player > Tools. This will allow you to automatically generate posts—be they for products or any kind of audio posts—from the MP3 files you choose.

After initiating the bulk creation, the newly formed posts will appear in draft mode. This setup allows you to conveniently review and publish them en masse.

For those looking to apply custom field values across multiple posts efficiently, the following plugins come highly recommended, significantly easing the management of your audio content:

Admin Columns Pro
Product Bulk Editor for WooCommerce

Updated on August 12, 2024
Was this article helpful?
Still Stuck?
We can help.