Shortcodes - [similar_properties]

About the shortcode

Output a list of similar properties to another property anywhere on the website, normally on a property details page, using the shortcode:

[similar_properties]

By default this will output 2 properties in a random order.

A ‘similar’ property is classed as one that has a price 10% either side of the property in questions, has the same number of bedrooms and is of the same department.

Use the attributes below to further filter the properties output, for example:

[similar_properties property_type_id="5" bedrooms="2" availability_id="5"] 

Attributes (display)

Attribute: carousel

Description: Displays properties as carousel slides with 'Next' and 'Prev' buttons to slide through it. Use the 'columns' attribute to specify how many properties show per slide.

Default: (empty)

Example: [similar_properties carousel="1"]


Attribute: per_page

Description: Determines the number of properties displayed

Default: 2

Example: [similar_properties per_page="4"]


Attribute: columns

Description: Determines the number of columns the properties appear in.

Default: 2

Example: [similar_properties columns="3"]


Attribute: no_results_output

Description: Message to show if no properties are found.

Default: (empty)

Example: [similar_properties no_results_output="No properties to display"]

Attributes (filtering properties)

Attribute: price_percentage_bounds

Description: The percentage higher or lower in price that determines a property be classed as 'similar'.

If the property in question was £100,000, a 'price_percentage_bounds' of '10' would search properties between £90,000 and £110,000.

Default: 10

Example: [similar_properties price_percentage_bounds="15"]


Attribute: bedroom_bounds

Description: The number of bedrooms higher or lower that determines a property be classed as 'similar'.

If the property in question had 5 bedrooms, a 'bedroom_bounds' of '1' would search properties with bedrooms between 4 and 6.

Default: 0

Example: [similar_properties bedroom_bounds="1"]


Attribute: matching_address_field

Description: Whether to only return properties with the same address element as the property in question.

Possible values: address_two, address_three, address_four, location

Default: (empty)

Example: [similar_properties matching_address_field="address_three"]


Attribute: availability_id

Description: Include properties based on their availability (For Sale, To Let, Under Offer etc).

The ID(s) can be found under 'Property Hive > Settings > Custom Fields'.

Supports multiple comma-delimited IDs.

Default: (empty)

Example: [similar_properties availability_id="5,8"]


Attributes (ordering)

Attribute: orderby

Description: The orderby argument passed through to WP_Query when querying the properties.

Default: rand

Example: [similar_properties orderby="date"]


Attribute: order

Description: The direction of order for properties based on the 'orderby' attribute

Default: desc

Example: [similar_properties order="asc"]