I am in my post.Show two custom fields. Custom field names:
1, downlink
2, demolink
I want to achieve, if the two values is empty, don't show my button.
<a href="<?php echo $downlink; ?>" class="btn btn-primary btn-large"><i class=" icon-eye-open icon-white"></i> download</a>
<a href="<?php echo $demolink; ?>" class="btn btn-primary btn-large" ><i class=" icon-eye-open icon-white"></i> DEMO </a>
How do I call?
You could do something like:
if($downlink != null || $downlink != "")
{
<a href="<?php echo $downlink; ?>" class="btn btn-primary btn-large"><i class=" icon-eye-open icon-white"></i> download</a>
}
if($demolink!= null || $demolink!= "")
{
<a href="<?php echo $demolink; ?>" class="btn btn-primary btn-large" ><i class=" icon-eye-open icon-white"></i> DEMO </a>
}
It wouldn't be perfect, but it's a start. You check if either value aren't blank, if they aren't show the links else show nothing.