[listing_category] Shortcode

This Listing Category feature allows for you to output a list of listings by any meta_key meta_value on your pages and posts using a simple Shortcode.

There are a variety of options available with this Shortcode in Easy Property Listings.
[listing_category]
You can output listings by a specific a specific meta key/value combination like this:
[listing_category category_key="property_bedrooms" category_value="3"]

Usage

There are several options that may be specified using this syntax:
[listing_category option1="value1" option2="value2"]

You can also print a list of listings in a template like so: <?php echo do_shortcode('[listing_category option1="value1" option2="value2"]'); ?>

Option Order

Note: The order of the options is important so order your options correctly to get the best result.
post_type
status
commercial_listing_type
category_key
category_value
category_compare
limit
offset
template
location
tools_top
tools_bottom
sortby
sort_order
pagination

Options

The following options are accepted:

post_type

specify which property type to display. The default is any activated listing type you have enabled. The option allows you to output multiple listing types by comma separating them "property,land" Options:

  • property
  • land
  • rental
  • rural
  • commercial
  • commercial_land
  • business
[listing_category post_type="property,land"]
status

specify the listing status to output. The default will output all of the following status's.

Options:

  • current
  • sold
  • leased
[listing_category post_type="property" status="sold"]
This also works:
[listing_category status="current,leased,sold"]

Note: withdrawn and offmarket status are prevented from display.

commercial_listing_type

specify the type of commercial listing it is, lease, sale or both. The default will output all commercial listings.

Options:

  • sale
  • lease
  • both
[listing_category commercial_listing_type="lease"]
category_key
This example we are filtering listings by House
[listing_category category_key="property_category" category_value="House"]
This example we are filtering the  Property listing type by Featured
[listing_category post_type="land" category_key="property_featured" category_value="yes"]
Filtering by listing type is possible using:
[listing_category post_type="rental" category_key="property_bedrooms" category_value="3"]
category_value
The category_value also accepts multiple values separated by commas. category_value="2,3,4" or category_value="House,Unit"
[listing_category category_key="meta_category" category_value="meta_value"]

filtering a listing by City/Suburb can be achieved using the location option.

category_compare
The category_compare allows you to exclude values. Default IN
[listing_category category_key="meta_category" category_value="meta_value" category_compare="NOT IN"]
limit
specify the number of listings that are output. The default is 10. For Example, to display 30 listings:
[listing_category limit="30"]
offset
specify the number of listings to skip that are output. The default is 0. For Example, you can now use multiple shortcodes on a single page and offset them so each will display a unique listing:
[listing_category offset="1"]
template

specify the template to use when outputting listings. The default is the blog view. Options:

  • slim
  • table
[listing_category template="table"]
location
specify the location of the listing so you can create a Sydney page and only output listings in that city. The option used is the location slug which works similar to post categories.
[listing_category location="sydney"]
If you are filtering by the Suburb field which can be renamed to City or whatever, the way to actually use that value is by the category key called:  property_address_suburb This also requires you to type in exactly as it appears in the box.
[listing_category category_key="property_address_suburb" category_value="Kings Cross"]

Edit_Listing_‹_Happy_Jack_Arizona_Real_Estate_—_WordPress

 tools_top
specify outputting the grid and sort options. Default is off.
[listing_category tools_top="on"]
tools_bottom
for future use.
[listing_category tools_bottom="off"]
sortby

specify outputting the order of the listings. Default is sorted by date newest first. Default is date. Options:

  • price
  • date
[listing_category sortby="price"]
sort_order

specify the order either ASC or DESC. Default DESC. Options:

  • ASC
  • DESC
[listing_category sort_order="ASC"]
pagination

specify outputting the pagination options. Default is on.

[listing_category pagination="off"]

Examples

Display Listings By Suburb

You can use either the taxonomy to display listings by suburb (however all content that has that suburb will display) or use the shortcode like this.

[listing_category post_type="property" category_key="property_suburb" category_value="albury"]

Display Listings By Exclusive Authority

[listing_category category_key="property_authority" category_value="exclusive"]

Shortcode options

'post_type' 		=>	$property_types,
'status'		=>	array('current' , 'sold' , 'leased' ),
'commercial_listing_type' =>	'',
'category_key'		=>	'',
'category_value'	=>	'',
'category_compare'	=>	'IN',
'limit'			=>	'10', // Number of maximum posts to show
'offset'		=>	0, // Offset Posts
'template'		=>	false, // Template can be set to "slim" for home open style template
'location'		=>	'', // Location slug. Should be a name like sorrento
'tools_top'		=>	'off', // Tools before the loop like Sorter and Grid on or off
'tools_bottom'		=>	'off', // For future usage
'sortby'		=>	'', // Options: price, date : Default date
'sort_order'		=>	'DESC',
'pagination'		=>	'on'

The order of the options is important with WordPress shortcodes.