I have a custom field in a woocommerce template. The values from the select box are 0 and 1.
If I put this in my product template file it will echo 1 or 0 depending on the selection made
<?php echo get_post_meta( get_the_ID(), '_select', true ); ?>
However I want to echo out a different button depending on the value with and if/else statement. When I try this the page just hangs and won't load with the following code...
<h1>
<?php
$grade = get_post_meta( get_the_ID(), '_select', true );
if ($grade == true) {
echo "<a class="button small secondary" title="" href="">True</a>";
}
else if ($grade == false){
echo "<a class="button small secondary" title="" href="">False</a>";
}
?>
</h1>
Any ideas why this is happening?