I want to check a variable value before a div so that if variable is empty then hide the div that is in if condition and vice versa.
e.g:
<?php $var=has_post_thumbnail();
if(!empty($var)){ ?>
<div>//some code that is shown only if var has some value</div>
<?php } ?>
1 Answer