Shortcodes

Introduction to shortcodes

Shortcodes are small snippets of code that can be added anywhere on your website to show Property Hive related elements and information.

An example of a shortcode is:

[properties]

When the page is constructed WordPress looks for any shortcodes and replaces them accordingly. The above example would be replaced by a list of properties.

Property Hive shortcodes

We have a wide array of shortcodes in Property Hive, from outputting search forms to properties:

The shortcodes listed below are ones found in the core Property Hive plugin. Additional features may come with their own shortcodes so it's worth checking the documentation for individual features too.

[property_search_form]

[properties]

[recent_properties]

[featured_properties]

[similar_properties]

[property_map]

[property_static_map]

[property_street_view]

[property_office_details]

[office_map]

[applicant_registration_form]

[propertyhive_login_form]

[propertyhive_my_account]

Using shortcodes

Adding shortcodes is as easy as entering them where you want them to appear when editing a page or post.

Let's imagine we want to show featured properties on a certain page, we could edit the page in WordPress and drop in the shortcode into the editor:

You also add shortcodes direct to templates by using the WordPress do_shortcode() function like so:

echo do_shortcode('[featured_properties]');