The sort by search tool allows you to sort posts/locations before displaying the search results. By using this tool, a select list that contains your sort by options will be added to your search form.
To add the sort by search to your form, follow these steps:
- Edit your search form
- Click on the menu “Sort by search”
- In the field “Use sort by search option?”, select the option “Yes”
- In the field “Title”, enter the title of the sort by search field (the field label).
- In the field “Description”, enter the description of the sort by search field (the field description).
- Read the following before saving the search form …
1. Sort by publish date
To add an option that allows sorting posts/locations by publish date, do the following:
- Scroll down to the area “Sort by publish date” and click on the group field “Sort by publish date options”
- In the field “Title”, enter the title of your sortby option (e.g. “Date”)
- In the field “Sort order”, select the options:
- ““: This will add an option that allows sorting posts/locations from newest to oldest.
- “Descending (3,2,1 | C,B,A)”: This will add an option that allows sorting posts/locations from oldest to newest.
- In the field “Descending suffix”, enter a suffix to display after the title for the descending option (e.g. “(Oldest first)”)
- In the field “Ascending suffix”, enter a suffix to display after the title for the ascending option (e.g. “(Newest first)”)
- To show/hide the “Sort by publish date”, select an option in the field “Visibility”
2. Sort by title
To add an option that allows sorting posts/locations by title, do the following:
- Scroll down to the area “Sort by title” and click on the group field “Sort by title options”
- In the field “Title”, enter the title of your sortby option (e.g. “Title”)
- In the field “Sort order”, select the options:
- ““: This will add an option that allows sorting posts/locations from A to Z.
- “Descending (3,2,1 | C,B,A)”: This will add an option that allows sorting posts/locations from Z to A.
- In the field “Descending suffix”, enter a suffix to display after the title for the descending option (e.g. “(Z to A)”)
- In the field “Ascending suffix”, enter a suffix to display after the title for the ascending option (e.g. “(A to Z)”)
- To show/hide the“Sort by title”, select an option in the field “Visibility”
3. Sort by custom fields
To add options that allows sorting posts/locations by custom fields, do the following:
- Scroll down to the area “Sort by custom fields” and click on the group field “Custom field options 1”
- In the field “Custom field name”, enter the name of your custom field.
- In the field “Custom field type”, select your custom field type.
- In the field “Title”, enter the title of your custom field (e.g. “Price”)
- In the field “Sort order”, select the options:
- ““: This will add an option that allows sorting posts/locations by custom field value from lowest to highest .
- “Descending (3,2,1 | C,B,A)”: This will add an option that allows sorting posts/locations by custom field value from highest to lowest.
- In the field “Descending suffix”, enter a suffix to display after the title for the descending option (e.g. “(Highest first)”)
- In the field “Ascending suffix”, enter a suffix to display after the title for the ascending option (e.g. “(Lowest first)”)
- To show/hide the custom field, select an option in the field “Visibility”
- To add another custom field, click on the button “Add new custom field” and repeat the steps from 2 to 8.