Templates

Auto Listings uses a template system very similar to the WooCommerce template system. If you have modified WooCommerce templates in the past, you will find this a very simple task.

How it works

  • All HTML output is generated using Template Files, which are located in the templates folder within the plugin.
  • To override the HTML output of the plugin, you need to include the correct Template File within a specified folder in your theme.
  • This Template File will then override the default file for that specific part of your listing(s).

The easiest way to get started is to open up the ‘templates’ folder within the Auto Listings plugin (wp-content/plugins/auto-listings/templates/) and take a look at the folder and file names within this templates folder. This will give an indication of what each file does.

As an example, the address.php file located in the ‘single-listing’ folder is used to output the HTML for each listings’ address. But you can override this HTML by creating an address.php file of your own and adding it to your theme in the correct location.
The folder you need to add these files to in your theme is the ‘listings’ folder, which you will need to create.

An example

To modify the HTML for each single listings’ address, we simply

  1. copy the address.php file located here – wp-content/plugins/auto-listings/templates/single-listing/address.php
  2. paste the address.php file into wp-content/themes/yourtheme/listings/single-listing/address.php

This new address.php file will then override the default address.php file and you can modify it as you need.

Folder & file hierarchy

You can do this with any file located within the plugin templates folder, so long as you keep the file structure and hierarchy the same.

Plugin file structure:

wp-content/plugins/auto-listings/templates/…. .php

Theme file structure:

wp-content/themes/yourtheme/listings/…. .php

So you are basically replacing the templates folder and renaming it listings within your theme. All internal files and folders can then follow the same naming conventions and hierarchy.