Templates / Customisation

This section is intended for developers and theme builders and explains how to customise the WP Property Feed layouts.  There are 12 layout files that sit in the templates directory of the plugin and all of these can be copied into the root directory of your theme to override the plugin defaults.  Simply make a copy of the templates you wish to override in your theme and the plugin will automatically use these instead, this is the only safe way to modify the layout templates.  You can also override the plugin stylesheet by also making a copy in your theme but you will need to dequeue and then enqueue your versions in your theme functions.php as follows;

add_action('wp_enqueue_scripts', 'mytheme_enque', 101);
function mytheme_enque() {
    wp_dequeue_style('wppf_properties');
    wp_enqueue_style('wppf_properties' locate_template('wppf.css'));
}

Archive Template

The plugin stores properties as a custom post type (wppf_property) so the archive naming follows the standard wordpress structure.  We include a standard top level archive file archive-wppf_property.php but you could also create specific taxonomy templates in addition.  The branch, property_area and property_type tags are all defined to allow for additional archive pages to be created within your theme.  This template defines the layout of the results page for the property search and you will note from version that it takes the layout property from the plugin settings to return various different layouts.  You can simply discard these and use your own layout if you wish.  The main thing to note is the inclusion of wppf_layout_results sub-template which displays the property results.

Single Template

Just as we have the standard archive template we also include the standard single one single-wppf_property.php.  This is the template that displays the property details.  In our version this is simply a container for the sub-template wppf_layout_property

wppf_layout_results.php (wppf_layout_results_nomap.php)

Template to display the property results with tabs for grid, list and map (not the nomap version excludes the map tab as this is indended for templates where the map is always present alongside the results).  The template uses standard WordPress loop methodology so provided you are familiar with wordpress coding the code within should be clear.  There is an explanation of the custom post type structure further down.

wppf_layout_map.php

Map layout which is very basic.  This includes a function to create the javascript map pins and a div map container.  Care should be taken to include both and maintain the div id naming.

wppf_layout_slider.php

Template for the full width property slider used by the wppf_slider shortcode

wppf_layout_featured.php

Template for the featured properties shortcode wppf_featured.

wppf_layout_search.php and wppf_layout_quicksearch.php

Templates for the two search shortcodes wppf_search and wppf_quicksearch respectively

wppf_layout_widgetsearch.php

Template for the Property Search widget.

wppf_layout_property.php

Template used in the single page to display the full property details.  See the full details of the Custom Post Type for details on the properties available

wppf_layout_enquiry.php

Template used for the wppf_enquiry shortcode.  This makes use of google reCaptcha and will email contents to the branch in question.  The fields on the form are specifically named to match the Vebra enquiries api so cannot be altered.

Custom Post Type – wppf_property

The plugin pulls all the feed data into a single custom post type.  This works just like any other custom post type with title, description, slug and featured image all available as normal.  In addition to this there are a number of taxonomies and meta data attached that can be used in your templates;

Taxonomies

  • branch – Name is the name of the branch but also includes meta fields phone and email.  We provide a function wppf_get_branch_address to get the branch address
  • property_area – This is will be To Buy, To Rent or Commercial
  • property_type – This links the property to the property type (House, Flat, etc)

Meta-data

  • featured – 1 or 0 – whether the property is featured or not
  • uploaded – date first uploaded
  • updated – date last updated
  • available – date property available
  • address_name
  • address_street
  • address_locality
  • address_town
  • address_postcode
  • address_custom
  • agent_ref
  • price_postfix
  • price_qualifier
  • price_currency (three letter currency code)
  • price_display (1 = yes, 0 = no)
  • price
  • fees
  • furnished (1 or 0)
  • let_type (i.e student, professional etc)
  • longitude
  • latitude
  • web_status (For Sale, SSTC, etc)
  • custom_status
  • premium
  • service_charge
  • rateable_value
  • let_bond
  • newbuild (1 or 0)
  • groundrent
  • propertyarea_sqft
  • propertyarea_sqm
  • landarea_unit
  • landarea
  • bedrooms
  • receptions
  • bathrooms
  • garden (1 or 0)
  • parking (1 or 0)
  • user1 (User specific fields – Alto only)
  • user2 (User specific fields – Alto only)
  • rm_qualifier
  • bullets
  • files (assoc array)
    • sortorder
    • filetype (0- Image, 1 – Map, 2 – Floorplan, 3 – 360, 4 – eHouse, 5 – Ipix, 7 – PDF, 8 – External URL, 9 – EPC, 10 – HIP, 11 – Virtual Tour)
    • name
    • url
  • pargraphs (assoc array)
    • sortorder
    • filesortorder – cross reference to files sortorder
    • name
    • dimensions
    • description