Create a condition that could be applied to any element on single attorney pages that will output it only if there is more than 1 attorney (other than the current one being viewed) in the locations that the attorney has been assigned to.
View: Single attorney pages
This members-only tutorial provides the PHP code for defining a custom function that
finds all the location terms that the current attorney CPT has
loops through the location terms and for each, get the attorney CPT items that have been assigned to that location and store this data in an array with the term ID being the key and post objects being the value
flattens the array
removes the duplicates from the array
returns a count of the number of items in the array
This function can then be used with Oxygen's PHP Function Return value Dynamic Data to output a Section only if there is at least one other attorney in the location(s) that the current attorney has been assigned to.
Step 1
Add a new Code Snippet on the front end using a plugin like WPCodeBox.