php - Adding an IF statement to not print a link if its URL is an empty string -
i have following code developer of wordpress site , if possible i'd make revision myself.
$list .= '<div class="fc_right"> <h3>'.$headline.'</h3> <div class="fc_caption">'.$caption.'</div> <a href="'.$url.'">more »</a> </div><div class="clear"></div> </li>'; i want add if statement in there if $url blank, don't print more>> link.
let me know if need provide more context of code, wanted keep brief if possible.
$list .= '<div class="fc_right"> <h3>'.$headline.'</h3> <div class="fc_caption">'.$caption.'</div>' . ($url == '' ? '' : '<a href="'.$url.'">more »</a>') . '</div><div class="clear"></div> </li>';
Comments
Post a Comment