(256) 829-8652
clbranson@gmail.com

Using Advanced Custom Fields

The Listing Page Template currently relies on the plugin Advanced Custom Fields to supply information for the Property Information sidebar within the template. Property information like cost or monthly rent and the number of bedrooms, bathrooms, and garage spaces.

Property Information On Listing Template
Property Information On Listing Template

Listing Information

In order to use this plugin, specific fields must be specified for the information to show up properly. These fields are:

  • monthly_rent
  • number_of_bedrooms
  • number_of_bathrooms
  • number_of_cars
  • availability
  • contact_link

Gallery Images

If you’d like to use Advanced Custom Fields to display an Orbit slider to display images on the Listing Template, you should have the following fields. Note that there are several available options for this task.

  • gallery_image_1
  • gallery_image_2
  • And so on up until…
  • gallery_image_19

The PHP code to import the Listing Information fields is:
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_listing-information',
'title' => 'Listing Information',
'fields' => array (
array (
'key' => 'field_5751ac42f64a3',
'label' => 'Cost',
'name' => 'monthly_rent',
'type' => 'text',
'instructions' => 'Cost or monthly rent of the listing',
'required' => 1,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5751ac4ff64a4',
'label' => 'Number of Bedrooms',
'name' => 'number_of_bedrooms',
'type' => 'text',
'instructions' => 'Number of bedrooms for the listing',
'required' => 1,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5751ac5bf64a5',
'label' => 'Number of Bathrooms',
'name' => 'number_of_bathrooms',
'type' => 'text',
'instructions' => 'Number of bathrooms for the listing',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5751adc58559f',
'label' => 'Number of Cars',
'name' => 'number_of_cars',
'type' => 'text',
'instructions' => 'Number of car garage spaces for the listing',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_5751b1f0855a0',
'label' => 'Availability',
'name' => 'availability',
'type' => 'text',
'instructions' => 'Enter availability of the listing.',
'required' => 1,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_576861bd8a65c',
'label' => 'Contact Link',
'name' => 'contact_link',
'type' => 'page_link',
'instructions' => 'Provide a link to your contact page.',
'required' => 1,
'post_type' => array (
0 => 'all',
),
'allow_null' => 0,
'multiple' => 0,
),
),
'location' => array (
array (
array (
'param' => 'page_template',
'operator' => '==',
'value' => 'listing.php',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}