WP Residence Help WP Residence Help

Home / Technical how to | Custom Code Required / Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence

Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence

200 views 0

By default, WPResidence requires property images to have a minimum width and height of 500px. If you wish to change this requirement, follow the steps below:

1. Modify the Minimum Dimensions in the Code

  1. Go to the file: themes\wpresidence\libs\ajax_upload.php

  2. Locate the following code:

if( !function_exists('fileupload_process') ):
function fileupload_process($file){
// Validate image dimensions (except for PDFs)
if( $file['type']!='application/pdf' ){
if( intval($file['height'])<500 || intval($file['width'])<500 ){ $response = array('success' => false,'image'=>true);
print json_encode($response);
exit;
}
}
}
endif;

Change the values 500 to your desired minimum width and height.

For example, to set a minimum size of 800×600, update the code as follows:

if( intval($file['height'])<600 || intval($file['width'])<800 ){

Update the Validation Message Displayed to Users

The text that informs users about the minimum image dimensions can be edited in two ways:

By editing the template file directly:
Go to: themes\wpresidence\templates\submit_templates\property_images.php

Using Loco Translate (Recommended):
If you are using translations, you can easily update the message via the Loco Translate plugin. Help https://help.wpresidence.net/article/how-to-rename-theme-words-with-loco-translate/

Technical how to | Custom Code Required

Related Articles

  • Introduction to WPResidence Header Customization
  • Understanding WPResidence Header Types: An Overview
  • Customizing the WPResidence Logo Display
  • Configuring the Primary Navigation Menu in WPResidence

WP Residence Documentation

Join Us On

Powered by WP Estate - All Rights Reserved