02/13/2014 at 10:31 am
#279985
Keymaster
@ Eric
Of the top of my head, I think this would work to show both:
foreach ( $entry->getCategory() as $category ) {
if ( $category->name == 'Provider' || $category->name == 'Researcher' ) $profession[] = $category->name;
}
Then to show them:
implode( ', ', $profession )
The code to only display a single address, let say just the first would be a bit more complex…
This would replace the getAddressBlock()
$address = $entry->getAddresses();
if ( isset( $address[0] ) ) {
echo '( ';
if ( ! empty( $address[0]->city ) ) echo $address[0]->city;
if ( ! empty( $address[0]->country ) ) echo ', ' , $address[0]->country;
echo ' )';
}
This is off the top of my head … I think it’ll work.