• hello,
    i’m working on one custom text for display on featured properties “For sale” or “For rent”.
    In admin panel i have create the attribute “Rent/Sale” with a choice in dropdow “Rent,Sale”.

    I have this :

    <?php if($property['rentsale'] = "Rent"){
    		echo "For rent";
    		}
    		else if($property['rentsale'] = "Sale"){
    		echo "for sale";
    		}else{
    		echo "see more";
    		}?>

    I have try <?php var_dump($property[‘rentsale’]);?>
    The result is ok for var_dump, but i don’t have the “echo” which i want “For rent” for “Rent” and “For sale” for “Sale”

    Do one see the problem or know how can i resolve this?

    Thanks and sorry for my bad english..

    Richard

    https://www.ads-software.com/plugins/wp-property/

Viewing 1 replies (of 1 total)
  • Best way to probably do it is change the dropdown options in the backend from ‘Rent’,’Sale’ to ‘For Rent’,’For Sale’.

    Then to output that field correctly you would use:

    <?php if( !empty( $property['rentsale'] ) ): ?>
       <div class="rent_sale"><?php echo $property['rentsale']; ?></div>
    <?php else: ?>
       <?php echo "See More"; //Not sure why you need this ?>
    <?php endif; ?>

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘custom text in property features’ is closed to new replies.