Archives

rem_states

This filter can be used to add/modify the states of a country.

Arguments

  1. States Data [Array]

Add/Modify States

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

Note: You must replace both instances of XX with your country code. This means each state id in the array must have your two-letter country code before the number you assign to the state.

add_filter( 'rem_states', 'custom_rem_states' );

function custom_rem_states( $states ) {

  $states['XX'] = array(
    'XX1' => 'State 1', 
    'XX2' => 'State 2'
  );

  return $states;
}

Example

The following snippet will add Portugal states.

add_filter( 'rem_states', 'custom_rem_states' );

function custom_rem_states( $states ) {

  $states['PT'] = array(
    'PT-01' => 'Alentejo', 
    'PT-02' => 'Algarve',
    'PT-03' => 'Beira',
    'PT-04' => 'Douro Litoral',
    'PT-05' => 'Minho',
    'PT-06' => 'Ribatejo',
  );

  return $states;
}

rem_attachments_title_length

This filter returns the number of characters for the attachment’s title to display.

Arguments

  1. Number of Characters [Integer]
  2. Property ID [Integer]
  3. Field’s Data [Array]

Example

Now if you want to increase the title’s length, you can use the following code.

You have to paste the following code inside the functions.php file of your active theme.

add_filter( 'rem_attachments_title_length', 'rem_change_attachment_title_length', 10, 1 );

function rem_change_attachment_title_length($length){
	return '30';
}

rem_property_field_value_separator

This filter can be used to change the field value separators used in Single Property Pages. By default, it displays colons.

Arguments

  1. Colons : [String]
  2. Field Data Name [String]
  3. Field’s All Data [Array]
  4. Property ID [Integer]

Example

The following code will display an equal sign instead of colons between field name and value. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_property_field_value_separator', 'rem_property_change_value_separator', 10, 1 );

function rem_property_change_value_separator($sep){
	return '=';
}

 

rem_single_property_grid_attrs

This filter is responsible for all the settings related to the Gallery Grid, on the Single Property Page.

Arguments

  1. Grid Settings [Array]

Default settings that we’re using are defined below

  • cells => 5
  • align => true

Example

Now if you want to change the cell numbers and don’t want to cut off the images, use the below example code.

You have to paste the following code inside the functions.php file of your active theme

add_filter( 'rem_single_property_grid_attrs', 'rem_custom_single_listing_grid', 10, 1 );

function rem_custom_single_listing_grid($settings){
	$settings['cells'] = 4;
	$settings['align'] = false;
	return $settings;
}

rem_single_property_slick_attrs

This filter is responsible for all the settings related to the Simple Gallery Slider, on the Single Property Page. We’re using the Slick library here.

Arguments

  1. Slick Settings [Array]

Default settings that we’re using are defined below

  • arrows => true
  • adaptiveHeight => true

Example

Now if you want to make this slider more interactive or enable more options, you can play with this filter. The following example code will make the single property page slider 3 images in a row and will also enable the bottom navigation dots.

You have to paste the following code inside the functions.php file of your theme to achieve this

add_filter( 'rem_single_property_slick_attrs', 'rem_custom_single_listing_slider', 10, 1 );

function rem_custom_single_listing_slider($settings){
	$settings['dots'] = true;
	$settings['slidesToShow'] = 3;
	return $settings;
}

rem_featured_image_size

This filter can be used to change the size of featured images of listings used in the listing archives.

Arguments

  1. Image size or array of width height [String|Integer[]]
  2. Image ID [Integer]

Example

The following code will set the featured image size to 200px by 200px. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_featured_image_size', 'rem_change_f_image_size', 10, 2 );

function rem_change_f_image_size($image_size, $id){
	return array( 200, 200);
}

 

rem_email_sender_email

This filter can be used to change the sender email address used in Emails. By default, REM uses WordPress admin’s email address for sending emails.

Arguments

  1. Admin Email Address [String]

Example

The following code will set the “from email address” in emails as rem@webcodingplace.com. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_email_sender_email', 'rem_change_sender_email', 10, 1 );

function rem_change_sender_email($email){
	return 'rem@webcodingplace.com';
}

 

rem_email_sender_title

This filter can be used to change the site title used in From Emails. By default, REM uses WordPress’s site title for sending emails.

Arguments

  1. Site Title [String]

Example

The following code will set the “from email” text as REM Notification. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_email_sender_title', 'rem_change_title_email', 10, 1 );

function rem_change_title_email($title){
	return 'REM Notification';
}

 

rem_change_admin_email

This filter can be used to change the admin email. By default, REM uses WordPress’s admin email for sending emails.

Arguments

  1. Admin Email [String]

Example

The following code will set the admin email to someone@gmail.com. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_change_admin_email', 'rem_change_admin_email', 10, 1 );

function rem_change_admin_email($email){
	return 'someone@gmail.com';
}