This filter can be used to add/modify the states of a country.
Arguments
- 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;
}
This filter returns the number of characters for the attachment’s title to display.
Arguments
- Number of Characters [Integer]
- Property ID [Integer]
- 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';
}
This filter can be used to change the field labels on the Single Property Pages. By default, it displays Field Title.
Arguments
- Field Title : [String]
- Field Data Name [String]
- Field’s All Data [Array]
- Property ID [Integer]
This filter can be used to change the field value separators used in Single Property Pages. By default, it displays colons.
Arguments
- Colons : [String]
- Field Data Name [String]
- Field’s All Data [Array]
- 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 '=';
}
This filter is responsible for all the settings related to the Gallery Grid, on the Single Property Page.
Arguments
- Grid Settings [Array]
Default settings that we’re using are defined below
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;
}
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
- 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;
}
This filter can be used to change the size of featured images of listings used in the listing archives.
Arguments
- Image size or array of width height [String|Integer[]]
- 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);
}
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
- 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';
}
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
- 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';
}
This filter can be used to change the admin email. By default, REM uses WordPress’s admin email for sending emails.
Arguments
- 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';
}