Hi, I created a custom field with type ‘radio’ called ‘transaction_type’ with two values: ‘buy’ & ‘sell’.
However, the following code is not working:
<?php if (get_field('transaction_type') = 'buy') { ?>
<td><?php the_field('purchase_price'); ?></td>
<?php } elseif (get_field('transaction_type') = 'sell') { ?>
<td><?php the_field('sell_price'); ?></td>
<?php } ?>
‘purchase_price’ & ‘sell_price’ are another two custom fields. They do not display on the front end. Other custom fields are displaying fine.
Help appreciated.
Hi @srd
I believe that you will need to change the equality operator to == like so:
<?php if (get_field('transaction_type') == 'buy') { ?>
<td><?php the_field('purchase_price'); ?></td>
<?php } elseif (get_field('transaction_type') == 'sell') { ?>
<td><?php the_field('sell_price'); ?></td>
<?php } ?>