I figure it is some change I need to make to the archive-listing.php page, some change in this line, just not sure what needs to be modified:
if ( ” != get_post_meta( $post->ID, ‘_listing_text’, true ) ) {
$loop .= sprintf( ‘<span class=”listing-text”>%s</span>’, get_post_meta( $post->ID, ‘_listing_text’, true ) );
} elseif ( ” != wp_listings_get_property_types() ) {
$loop .= sprintf( ‘<span class=”listing-property-type”>%s</span>’, wp_listings_get_property_types() );
}
The banner is actually pulling from the listing Status taxonomy, not Property Type. While it may be possible to change that to use property type, and to include more than one, the banner has limited space so you would have issues displaying more than one.
I understand the limited space for the status, but what would need to be done to wrap the text so that the status is not on one line?
You would need to modify the plugin’s functions.php and replace the wp_listings_get_status function with this:
/**
* Displays the status (active, pending, sold, for rent) of a listing
*/
function wp_listings_get_status($post_id = null, $single = 0) {
if ( null == $post_id ) {
global $post;
$post_id = $post->ID;
}
$listing_status = wp_get_object_terms($post_id, 'status');
if ( empty($listing_status) || is_wp_error($listing_status) ) {
return;
}
$status = null;
foreach($listing_status as $term) {
if ( $term->name != 'Featured') {
$status .= $term->name;
if($single == 1) {
return $status;
}
$status .= '<br />';
}
}
return $status;
}
What about the property type, would I use the same?
I don’t think we are talking about the same thing. I am talking about the white bar that goes across the bottom of the image in the listings page, the one over top of the pricing bar. The one that says whether it is a home, condo or residential (property type). I need that bar to say all the property types selected, not just the first one. So say I have a property that is both residential and a townhouse, I want both to show. I am not talking about the diagonal status bar that says For Rent or Sold or For Sale (status taxonomy). Anyway to do this?
Never mind, I figured it out. Changed this code:
$loop .= sprintf( ‘<span class=”listing-property-type”>%s</span>’, wp_listings_get_property_types() );
To this code:
$loop .= sprintf( ‘<span class=”listing-property-type”>%s</span>’, get_the_term_list( get_the_ID(), ‘property-types’, ”, ‘, ‘, ” ) );