Conditional check if a property has a specific attribute
-
Hi,
I have WP Property set up with my custom property attributes. One of attributes is location, which has two options – City A and City B. Now I would like to make a conditional check on the single property view. If the property is in City A the page would show some extra content and if it is in City B there would be some other extra content.
I know how to do regular conditional WP functions, but I can’t figure out how to include the location attribute in the function. Could you help me with this?
Here is an rough example what I mean,
if ( is_single ( 'property' ) && has_my_custom_attribute()) { my_custom_content } else return;
So how do I check if a property has specific attribute?
Thanks,
kantti
- The topic ‘Conditional check if a property has a specific attribute’ is closed to new replies.