Technical how to | Custom Code Required

This technical help has been written by our development team based on the answers/directions provided to our clients who have asked for directions to modify the code. We published them hoping that they will help other clients with similar requests implement the modifications faster.

Please keep in mind that theme customization services ARE NOT included in the client standard support. Our support team cannot do code modifications for you.

Item support is a service provided directly by us through the FreshDesk ticket system. Support is limited to questions regarding the theme’s features or problems with the theme. We are not able to provide support for code customizations or third-party plugins.

Please read the full Themeforest support policy is available here for further information (https://themeforest.net/page/item_support_policy).

Technical How to: How Login /Signup works

In WPResidence both register and login functions works via ajax: That means the action is triggred via JavaScript and the actual login/signup is made in php. For example when you push the login button a javascript function is called $(‘#wp-login-but-topbar’).click(function () { wpestate_login_topbar(); }); In the function wpestate_login_topbar() we read the username and pass and send […]

Technical How to: print functions on property page

The print function that appears on the property page is made via ajax. It means the action is triggered in the JavaScript while the actual print function is in php. The JavaScript code can be fond in control.js around line 700 $(‘#print_page’).click(function(event){ var prop_id, myWindow, ajaxurl;   The php function that create the “print” is  […]

Technical how to remove default property fields

If you wish to delete the fields that are not in the custom fields list, these are the files to modify compare_listings.php – compare page libs/listing_functions.php – front end page libs/property.php – admin edit property page templates/submit_templates/ – submit form Example: Remove Bedrooms from property front page: Go to libs/listing_functions.php Comment or delete this code: […]

How to add a new Google font

The easiest way to add google fonts is by using WP Google Fonts plugin: https://wordpress.org/plugins/wp-google-fonts/  In a child theme functions.php add the following code add_action(‘wp_enqueue_scripts’, ‘wpestate_scripts_childtheme’); function wpestate_scripts_childtheme() { $protocol = is_ssl() ? ‘https’ : ‘http’; wp_enqueue_style( ‘wpestate-railway’, “$protocol://fonts.googleapis.com/css?family=Raleway:500,600,400,700,800&subset=latin,latin-ext” ); } Now, you need to replace the raleway font in the above example with your […]

Optimize images

From what we know EWWW Image Optimizer plugin can resize automatically the images to a max width or height. Please see this plugin: https://wordpress.org/plugins/ewww-image-optimizer…

Remove/change navigational arrows

To remove navigational arrows from property page use this CSS .nav-prev-wrapper, .nav-next-wrapper{ display:none!important; } Help article about how to add custom CSS Tip: If you have theme cache enabled, make sure you clear cache to see instant results.

Make property slider thumbs closed by default

You need to edit the templates/listingslider.php 1. On the divs with the class   carousel-indicators  add the extra class rowclosed. After editing should look like  class=“carousel-indicators rowclosed”. 2. After that you need to add rowclosed  class  to the div that has the class  “carusel-back “. <div class=”carusel-back rowclosed”></div> and closed class needs to added to div with […]

Technical how to : Shortcode files / shortcodes functions

All the shortcodes are registered in wp-content\plugins\wpresidence-core\shortcodes\shortcodes_install.php In function wpestate_register_button() we add the shortcode buttons to the WordPress visual editor while in wpestate_register_shortcodes() function we register the actual short code and attach it to a function. The shortocdes are added to visual composer interface via vc_map instruction around line 115. if( function_exists(‘vc_map’) ): vc_map( All […]

Technical how to : widgets files / widget functions

Widgets files All the widgets are registred in wp-content\plugins\wpresidence-core\widgets.php if( !function_exists(‘register_wpestate_widgets’) ): function register_wpestate_widgets() { wpestate_widgets_init(); register_widget(‘Tweet_Widget’); register_widget(‘Facebook_Widget’); register_widget(‘Mortgage_widget’); register_widget(‘Contact_widget’); register_widget(‘Social_widget’); register_widget(‘Featured_widget’); register_widget(‘Footer_latest_widget’); register_widget(‘Advanced_Search_widget’); register_widget(‘Zillow_Estimate_Widget’); register_widget(‘Login_widget’); register_widget(‘Social_widget_top’); register_widget(‘Featured_Agent’); register_widget(‘Multiple_currency_widget’); } Each widget is in a separate file (in wp-content\plugins\wpresidence-core\/widgets folder) included like this require(‘widgets/twiter.php’); The name of the files are self-explanatory.

Technical how to : similar articles / similar blog posts

The related posts code is located in templates/related_posts In there we create the similar query by using the tags of the currents posts ‘tag__in’ => array($first_tag), The actual query is made at line 28 $my_query = new WP_Query($args); while the blog list display is made via get_template_part(‘templates/related_post_unit’); Please note that for related posts we use […]

Technical how to: How i can add new fields / new sorting order for the properties list.

This document works for standard property list and  for property category pages (if you chose standard display). The property list page (property_list.php) and the property category pages (taxonomy.php) are displaying the lists using a template file called normal_map_core.php In this file, we load another template file that contains the HTML code for the filters get_template_part(‘templates/property_list_filters’); […]

Technical how to : standard property list explained

The standard property list page file has the code in the property_list.php. The first thing you need to know is that we built the property list using the wp_query instruction from wordpress. If you plan to change the property list you need to be familiar with how the wp_query works. Detailed explanations can be found […]

Technical how to : change blog details ( in blog page)

The page for the blog post is single.php In there we display the title arond line 15 if (esc_html( get_post_meta($post->ID, ‘post_show_title’, true) ) != ‘no’) { ?> <h1 class=”entry-title single-title” ><?php the_title(); ?></h1> <?php } while the actual content is displayed at line 52 the_content(‘Continue Reading’); The image slider is loaded at line 51 via […]

Technical how to : change blog details ( in blog list)

DISCLAIMER: This technical help has been written by our development team based on the answers/directions provided to our clients who have asked for directions to modify the code. We published them hoping that they will help other clients with similar requests implement the modifications faster. Please keep in mind that theme customization services ARE NOT […]

Technical how to : change agent details ( in agent list)

The agent card/ agent unit is located in templates/agent_unit.php In there we read the agent details and we display the information. Agent details like phone or mobile are saved as post meta and can be loaded with get_post_meta $agent_mobile       = esc_html( get_post_meta($post->ID, ‘agent_mobile’, true) ); Agent image is saved as post attachment. […]

Technical how to: files related to property

Files related to the property posts – wp-content\plugins\wpresidence-core\post-types\property.php”- this is where custom post types and properties taxonomy are defined – wp-content\themes\single_estate_property.php – this is the property page – wp-content\themes\advanced_search_results.php – this is the file for advanced search page results – wp-content\themes\property_list.php – this is the default page for property list – wp-content\themes\property_list_half.php – this is […]

Technical how to : Delete agent email

To delete agent email from agent page  try this css in wp-admin -Appearance  –  Theme options – Design – Custom css .agent_meta a { display: none; } To delete agent email -agent on sideber- from property page go in agent_unit_widget.php and delete below code: if ($agent_email) { print ‘<div class=”agent_detail”><i class=”fa fa-envelope-o”></i>’ . $agent_email . […]

Technical how to: Add date in property unit ( property card )

If you want to add the date on the property unit/card in front end (will apply to all property units – including shortcodes) Details are stored after 3.1 theme update in: templates/property_cards_templates/property_card_details_default.php <?php $my_date =get_the_date(); echo $my_date; ?> If you want to add the date on property_unit/card in user dashboard edit dashboard_listing_unit.php and add the […]

Technical how to: User dashboard menu

There are 2 types of user menu – both are generated by the same function wpestate_generate_user_menu(). The function is located in libs/dashboard_functions.php –  function wpestate_generate_user_menu at line 1429. The top menu is in templates/user_menu.php .  It uses the wpestate_generate_user_menu to show the menu <div class=”user_tab_menu”> <ul class=”user_dashboard_links”> <?php wpestate_generate_user_menu(); ?> </ul> </div> The menu on right […]

Technical how to : Properties and Images

On WPResidence the images you or one of your users upload are saved like using WordPress default mechanism. More exactly : all images are saved as post attachments  and can be managed via Media section of the wordpress admin interface. More information about attachment : http://www.wpbeginner.com/glossary/attachment/ If you did not change the path of the upload images then […]

Technical How To : Property page – Features and Amenities

The features and amenities section from property page is displayed using the function estate_listing_features(). This function is in listings.php at line 102. In this function there is a if around line 116 if($show_no_features!=’no’){ Here we check if the theme is set to show also the features that are NOT present on that property. The code that actual […]

Technical how to : Agent contact form explained

The agent contact form that is present in property page (at the bottom or on sidebar) and in agent page can be found in the following file: wpresidence/templates/agent_contact.php Here you can find the HTML code and can change labels or add extra details. The email sending is happening via ajax. This means that the code […]

Technical how to: Advanced Search explained – advanced search results page

The advanced search results page is made by publishing a page with the the template “Advanced Search Results” template. The file for this template is advanced_search_results.php *** IMPORTANT: we only use WordPress wp_query ( and an array of arguments that is usually named $args) when doing the actual search.  Wordpress has an extended article about wp_query […]

Technical how to: Advanced Search explained – advanced search forms

How advanced search forms are displayed The advanced search forms are displayed via advanced_search.php. Here we load different templates accordingly to the what type of search you selected. if ($adv_search_type==1){ include(locate_template(‘templates/advanced_search_type1.php’)); }else if ($adv_search_type==3){ include(locate_template(‘templates/advanced_search_type3.php’)); }else if ($adv_search_type==4){ include(locate_template(‘templates/advanced_search_type4.php’)); }else if ($adv_search_type==5){ include(locate_template(‘templates/advanced_search_type5.php’)); }else if ($adv_search_type==6){ include(locate_template(‘templates/advanced_search_type6.php’)); }else if ($adv_search_type==7){ include(locate_template(‘templates/advanced_search_type7.php’)); } else if ($adv_search_type==8){ […]

Remove infobox on property page map

Question : How to remove infobox on property page map Answer: Solution 1 If the map is embed in the picture slider Please go into google_map_code_listings.js and remove below line google.maps.event.trigger(gmarkers[found_id], ‘click’); If not go into mapfunctions.js and remove google.maps.event.trigger(gmarkers_sh[0], ‘click’); Solution 2 Use below CSS: .single-estate_property .info_details { display: none; } Help for custom css: https://help.wpresidence.net/article/how-to-add-custom-css/

Technical how to : change agent details ( in agent page)

The agent page  is displayed by the file single-estate_agent.php . In this page there are 3 main components: The agent details which is located in templates/agentdetails.php Here we display the agent details like phone, skype etc. The details are saved as custom meta for the estate_agent custom post type. They are retried using get_post_meta $agent_phone = esc_html( get_post_meta($post->ID, […]

Technical how to : change property submission page details

The property submission page is user_dashboard_add.php . On this page we check the submission info submitted by users and if everything checks out we add or edit the property. The actual front end page – where the users submit the data is split between several pages. We start with templates/front_end_submission.php and then we load various modules […]

Technical how to : change property page details

The property page is displayed using the single-estate_property.php file. On the property page you can pick between two types : horizontal and vertical. You can set a global slider value (to be applied on all listings) or you can pick one per page. This is the code that loads the slider: if ($local_pgpr_slider_type_status==’global’){ $prpg_slider_type_status= esc_html ( […]

Technical how to : Default property fields

Besides the default properties, details like title, images or description the WPResidence features some real estate specific fields like address, geo coordinates, price, size etc… These default fields are set in wp-content\plugins\wpresidence-core\post-types\property.php  with the function details_estate_box (). These fields are saved as meta options of the custom post type property. To retrieve these fields you need to […]

Technical how to : Custom fields

The custom fields for properties are saved as an wordpress theme option. In order to view them all you can use this code $custom_fields = wpresidence_get_option( ‘wp_estate_custom_fields’, ”); print_r($custom_fields); ***the code above is not for production sites If you did print the custom fields arrays you will see that we have stored the name, the […]

Technical how to : Add details to property card unit (in property list)

In WpResidence you can choose between 7 built-in property cards for properties that will be used in all lists, in grid view, or list view by default. You can choose a default built-in property card or you can work on a custom unit by using the Custom Property Card Unit builder (beta version). Help article […]