True / False custom field for Featured label

Hi,

I’m trying to create a simple ‘Featured’ label based off true / false advanced custom feild.

In the property post type, if the product is featured you tick the box, if it’s not featured you leave it unticked by default.

Custom field is true / false - field name $featured_property

Here is the frontend labels.

I tried this… but failed

<?php $true = get_post_meta( get_the_ID(), 'featured_property', true ); ?>
    if ( $true == '1' ) {
<span class="property-badge">Featured</span>
}

Any tips please for a newb!

Sponsor our Newsletter | Privacy Policy | Terms of Service