This is probably the most important shortcode as it displays the listings archive on a static page (see demo). When you first activate WPCasa the shortcode will automatically be added to the static page Listings. But of course you can place it on any page you want.
The wide range of parameters and options make it a powerful tool to organize the display of your listings the way you need it.
Usage
[wpsight_listings]
Parameters
keyword
Search keyword that required listings need to match.
offer
The offer of the required listings. Can be any of the registered offers (e.g. offer="rent"
). Also see wpsight_offers().
[detail]
The query_var of any registered listing detail (also see wpsight_details() – e.g. built_in="2010"
). By default the following details are available: bedrooms, bathrooms, plot_size, living_area, terrace, parking, heating, built_in
[taxonomy]
The key of any registered taxonomy of the listing post type (use taxonomy and term slug – e.g. location="marbella"
). By default the following taxonomies are available: location, listing-type, feature, listing-category. Use multiple terms separated by comma.
availability
Defines if only available, unavailable or all listings should be included. Default all
min
Minimun price that required listings should have. Don’t use currency symbols or thousands separators.
max
Maximum price that required listings should have. Don’t use currency symbols or thousands separators.
nr
Number of listings to show per page before pagination applies. Defaults to 10
(WordPress settings).
orderby
Sort retrieved listings by parameter. Defaults to date
(post_date). Other options are price, title, name (slug), rand (random).
order
Designates the ascending or descending order of the orderby parameter. Defaults to DESC
. Can be ASC.
show_panel
Define whether or not to display the listings panel (displayed before listings). Defaults to true
.
show_paging
Define whether or not to display the listings pagination (displayed after listings). Defaults to true
.
before
Display some short content (e.g. a special note) right before the shortcode output. Is empty
by default.
after
Display some short content (e.g. a special note) right after the shortcode output. Is empty
by default.
wrap
HTML tag of the container element of the shortcode. Defaults to div
.
Example
The following example shows 6 listings on the same page, does not show the panel bar before the listings and orders the listings by price in a descending order.
[wpsight_listings nr="6" show_panel="false" orderby="price" order="desc"]
Or display the latest listings for rent.
[wpsight_listings offer="rent"]
Or display the latest listings from multiple locations
[wpsight_listings offer="rent" location="marbella,madrid"]
Source File
/includes/shortcodes/class-wpsight-shortcode-listings.php