Reputation: 19
I have added the following code to display "Featured: yes/no":
<div class="event-package-content">
Featured: <?php echo $product->get_event_listing_featured(); ?>
</div>
I would like to change it to display only the word "Featured" under the package if the package is featured instead of "yes/no".
Package screenshot:
Packages (shows after filling in details)
Can anyone please help?
Thanks.
Upvotes: 1
Views: 45
Reputation: 9097
You could replace your code:
<div class="event-package-content">
Featured: <?php echo $product->get_event_listing_featured(); ?>
</div>
With this:
<div class="event-package-content">
<?php echo ($product->get_event_listing_featured() == "yes") ? "Featured": ""; ?>
</div>
Upvotes: 2