How to filter listings using WPL shortcode
WPL has a flexible shortcode so you can do almost everything that you need for filtering listings using this shortcode.
Shortcode structure is
["WPL parameter1"="value1" "parameter2"="value2" ....]
Note: Parameters were put in quotes only to prevent rendering on this page.
To filter use parameters. For example placing
sf_select_listing="9" will filter “For Sale” listings. This parameter has 3 parts.
All filtering parameters start with sf prefix.
It’s operand of your query, you can use following operand types:
select: It uses for looking for a certain value into the listings. For example
sf_select_property_type="6" will create
`property_type`="6"into the query for finding the listings that have “Apartment” for their property_type column.
notselect: It acts as opposite of select. It adds
`property_type`!="6" into the query for finding the listings that are not “Apartment”.
multiple: If you want to look for a multiple values, you can use this operand. For example
sf_multiple_listing="9,10" looks for listings that are For Sale and For Rent by creating
`listing` IN (9,10) query.
text: If you want to search on a listings with a term, then you can use this operand type. for example
`field_312` LIKE '%Johnson%' for finding all listings that have “Johnson” term into their title.
tmin: You can use it for numeric filters. For example if you place
sf_tmin_bedrooms="2" into the shortcode, then it will add
`bedrooms`>='2'to the query for finding listings that have more than 1 bedroom.
tmax: It acts like tmin but for maximum search. For example if you place
sf_tmax_bedrooms="2" into the shortcode, then it will add
`bedrooms`<='2' to the query for finding listings that have less than 2 bedrooms.
between: It’s a combination of tmin and tmax. For example if you place
sf_between_bathrooms="1:3" into the shortcode, then it will generate
`bathrooms`>=1 AND `bathrooms`<=3 into the query.
datemin and datemax: They act like tmin and tmax operands but for date fields.
The third part is column name, You can find the column name in the dbst table for your desired field.
Note: You can insert multiple filtering parameters into the shortcode.