Themer Documentation

The information provided here is intended for user with minimal PHP knowledge and general knowledge on how to identify and replace WordPress Loop.

It is recommended to create a separate archive template for property rather than using theme default archive.php or index.php.

Step One – Locate theme file

You will need to locate theme archive.php or index.php which usually located in the root folder of your theme.

Step Two – Clone the file

After you have found the file as in step one, you will need to copy the file and use archive-property.php as the new filename.

Step Three – Change the loop

In the newly copied file, find the theme code for WordPress Loop, usually it is wrapped inside PHP while syntax.

Example loop code from WordPress twentytwelve theme :


/* Start the Loop */
while ( have_posts() ) : the_post();

	/* Include the post format-specific template for the content. If you want to
	 * this in a child theme then include a file called called content-___.php
	 * (where ___ is the post format) and that will be used instead.
	 */
	get_template_part( 'content', get_post_format() );

endwhile;

twentytwelve_content_nav( 'nav-below' );

Change the loop template into this code :

			
if (class_exists('VTCore_Wordpress_Utility')) {
  include VTCore_Wordpress_Utility::locateTemplate('property-loop.php');
}

It is recommended to create a separate single page template for property rather than using theme default page.php or single.php or index.php.

Step One – Locate theme file

You will need to locate theme page.php or single.php or index.php which usually located in the root folder of your theme.

Step Two – Clone the file

After you have found the file as in step one, you will need to copy the file and use single-property.php as the new filename.

Step Three – Change the loop

In the newly copied file, find the theme code for WordPress Loop, usually it is wrapped inside PHP while syntax.

Change the loop into this new code :

			
if (class_exists('VTCore_Wordpress_Utility')) {
  include VTCore_Wordpress_Utility::locateTemplate('property-content.php');
}  

If there is no valid agents listing page then the plugin will useĀ author.php
template which will display all author posts instead of listing of agents. Therefore it is strongly suggested to create a custom agents listing template in your theme.

Step One – Locate theme file

You will need to locate theme page.php or single.php or author.php or index.php which usually located in the root folder of your theme.

Step Two – Clone the file

After you have found the file as in step one, you will need to copy the file and use archive-agents.php as the new filename.

Step Three – Change the loop

In the newly copied file, find the theme code for WordPress Loop, usually it is wrapped inside PHP while syntax.

Change the loop into this new code :

			
if (class_exists('VTCore_Wordpress_Utility')) {
  include VTCore_Wordpress_Utility::locateTemplate('agents-loop.php');
}

If there is no valid agents profile page then the plugin will useĀ author.php
template which will display all author posts instead the agents profile page. Therefore you must create a custom agents profile template to display the author profile information.

Step One – Locate theme file

You will need to locate theme page.php or single.php or index.php which usually located in the root folder of your theme.

Step Two – Clone the file

After you have found the file as in step one, you will need to copy the file and use author-agents.php as the new filename.

Step Three – Change the loop

In the newly copied file, find the theme code for WordPress Loop, usually it is wrapped inside PHP while syntax.

Change the loop into this new code :


if (class_exists('VTCore_Wordpress_Utility')) {
  include VTCore_Wordpress_Utility::locateTemplate('agents-profile.php');
}

You can override all templates found in victheme_property/templates folder by creating an new folder with this structure templates/property/ in the root of your theme.

Then copy the templates files that you want to override from victheme_property/templates folder into the newly created folder in the {your_theme}/templates/property/

Afterwards you will need to visit http://yoursite.com/wp-admin/admin.php?page=vtcore-configuration and click on the clear cache button to refresh the core template cached folder.

For overriding property agents templates found in the folder victheme_agents/templates , You must create a new folder called templates/agents in your theme root folder and copy the template file to be overridden to it.

You can override any of the VicTheme Property or VicTheme Agents or VicTheme Core plugins default CSS and Javascript assets by registering a new assets to replace the old assets.

For example, to override the property-front.css which is bundled inside the property-front assets you can do the following steps :

Step One – Registering theme assets folder

Create a new folder called /assets in your theme root folder.

Then add this code to your theme functions.php :

			
if (class_exists('VTCore_Wordpress_Init')) {

  $themePath = get_stylesheet_directory();
  $themeUrl = get_stylesheet_directory_uri();

  VTCore_Wordpress_Init::getFactory('assets')
    ->get('library')
    ->detect($themePath . DIRECTORY_SEPARATOR . 'assets', $themeUrl . '/assets');
}

Step Two – Copy The Old Assets Folder Into New one

Copy the old assets folder (in this case is victheme_property/assets/property-front) into the newly created folder at {theme_path}/assets .

Notice that the folder name will be the assets name.

Step Three – Edit The assets

Edit the copied assets to match your customization.

Now whenever plugin / themes called the core assets factory to load the assets file, the factory will load your overridden assets instead of the original one.