[ASFB] – Filters Option

Continue to the previous article of General options, this article will guide you through the filter options – the core of the plugin logic.

Post type source

Post type source is the setting that will tell the search form where to search the info.

It’s the source of information that the plugin will look for whenever the user hit “search” button.

On the selection list, you will be able to select the post types, it’s multiple selection so you’re freely to choose the post types that you want to look for.

Post field

This setting is the on/off switch, if you want to look for the information, include the post title, just switch this option to ON.

This setting also the on/off switch, beside the look for title, the search form also search the keyword that user type in post’s content.

This setting just like search the post’s content, but the length of source text will be limited as it’s the short description of your content.

You only need to enable either search in post content or post excerpt, enable both of the settings will cause slowing down of the search speed

Filter taxonomy

This is the most important logic of the search form, it will define the search criteria, using taxonomy.

The taxonomy, it can be either “category” or “tag”.

Taxonomy Logic

Relation taxonomy, it’s the search method, to be clear and easier to understand, you only can select “AND” or “OR” method.

AND method: With this selection, your search query in the final form will be something like this:

Search for posts that have in Food AND Western category

OR method: With this selection, your search query in the final form will be:

Search for posts that either in Shirt category or Pants category

In this article, it’s just the settings and show you the idea of the plugin, for how to create the taxonomy filter, we already created the video for you, you can watch it in detail here.

Custom field filter

Custom field filter logic is the same with the taxonomy, but the source of information not.

This custom field filter is helpful when you create the website with custom field, such as WooCommerce product will have the price. And that price value will be stored under _price custom meta key.

To know more about the meta key, you can look at this article: https://codex.wordpress.org/Custom_Fields

Custom field logic

This setting also the same with taxonomy search method, it can be AND or OR.

Note 1: Using OR method might cause slow search speed
Note 2: If you choose the OR search method, but you have more than 3 custom fields, the plugin will automatically turn to AND method, because with more than 3 filter, the speed will be slowed down significant!

To know how to create search criteria with custom field, please see the video here

Was this article helpful?

Related Articles

Leave A Comment?

54 − = 46