If/then to show icon next to property_attribute
-
I’m putting property_attribute shortcodes into a template file (property.php) in my child theme to customize the individual listings. What I want to do is have an icon show next to an attribute – e.g. a bed next to the number of bedrooms. So i have this so far –
<span class="bed"><?php echo do_shortcode("[property_attribute attribute=bedrooms]"); ?> <i class="fa fa-bed"></i></span>
How do I alter that code so the bed only shows if that attribute is filled in? Some of the listings are land, and will not have beds / baths. I know it’s an if/then sort of set up, but my PHP isn’t great!
- The topic ‘If/then to show icon next to property_attribute’ is closed to new replies.