different pages to the single-ad_listing.php
I use ClassiPress 3.3 and would like to use single-ad_listing pages with different visual for two types of categories, category-1: () vehicles (single-ad_veiculos 1.php tailor), category-2: (else if) Rent (single-ad_aluguel -2.php) and general category: the single-ad_listing who will get default. How to do this in ClassiPress 3.3? Has anyone used this way, what code should I use? I did this training put the code inside the single-ad_listing.php: and it did not work, where am I going wrong ?:
<?php
$post = $wp_query->post;
/*if the rental category, show */
if (in_category('alugue-por-dia')) {
include (TEMPLATEPATH.'/single-ad_alugue.php');
return;
}
/* if the vehicles category, show */
if (in_category('veiculos')) {
include (TEMPLATEPATH.'/single-ad_veiculos.php');
return;
}
/* if not any of the categories above, shows */
else { ?>
<? include (TEMPLATEPATH.'/single-ad_alugue-por-dia.php'); ?>
<?php } ?>
. I appreciate the help.