Monthly Archives: January 2017

BP Profile Search 4.7

BP Profile Search version 4.7 allows you to sort your search results using profile fields, adding those options to the Order By drop-down in the search results page.

As you may recall, the ability to build a custom search results page with the [bps_directory] shortcode was added in version 4.1. Now that shortcode accepts a new attribute:

[bps_directory order_by=field_xyz]

where xyz is the ID of the profile field you wish to use. For instance, if you have a profile field City with ID 35, and a field Graduation Date with ID 12, the shortcode:

[bps_directory order_by=field_35]

adds the option City to the Order By drop-down.

When a visitor selects City from the Order By drop-down, the directory (or the search results if a search is active) will be sorted by city, ascending. At the same time, the value of the City field will be displayed in each member’s entry.

The sort direction is asc (ascending) by default, but you can specify desc (descending) or both (both directions). For instance the shortcode:

[bps_directory order_by='field_35 both, field_12 desc']

adds the options City ⇡, City ⇣ and Graduation Date to the Order By drop-down. When a visitor selects Graduation Date from the Order By drop-down, the directory (or the search results if a search is active) will be sorted by graduation date, descending. If they select City ⇡ or City ⇣, the directory will be ordered by city, respectively ascending or descending.

For a complete overview of the [bps_directory] shortcode, see the Custom Directories tutorial.