Advanced Options -> Grouping
Results grouping obviously works with the Vertical results layout type only.
The plugin offers three types of grouping: by Post type, by Categories or taxonomy terms or by content type.
Some options are the same for all three grouping types, let's look at them first.
- Group header prefix/suffix text - text appearing before and after the group header
- If results does not match any group? - what to do with the items that doesn't match any of the selected groups.
- Other results group text and location - The text and the location of the 'Other results' group, which contains the items that does not belong to any of the selected groups.
- Display duplicates only in the first group match? - Mainly used in category based grouping. For example: when a post matches multiple category groups, this option allows to display it in all groups.
- Show results count in group headers - Will display the matches count per group in the group header between brackets.
When using multiple post types as results sources (posts, pages, products, portfolio etc..) the plugin will group the result into these post type groups.
After choosing this option you will also have to choose for which post types the plugin should make a group for.
NOTE 1: If a post type does not belong to any of the selected groups, then it's either moved to the 'Other results' group or is removed, depending on how you configure it.
NOTE 2: This option only affects grouping, so if you select post types which are not chosen for search on ghe
General Options -> Sourcespanel, it still won't search for them.
The above example will yield this result:
In this case the groups will be formed based on the selected taxonomy terms (categories).
NOTE: If a post type does not belong to any of the selected category groups, then it's either moved to the 'Other results' group or is removed, depending on how you configure it.
When having multiple content types as results: posts, attachments, users, tags etc.. this option allows separating them into groups.
You can change the order and the text of the individual items as well.