0

I'm coding my author template.

I want something like this

<?php if(Author filled about me)) { ?>
                        <div class="title">About me</div>
                        <div class="descwrap">
                        <div class="descinner"><?php echo about me; ?>
                        </div>
                        </div>
                        <?php } ?>

I tried this code. But its not working.

<?php if(isset($curauth->description)) { ?>
                        <div class="title">About me</div>
                        <div class="descwrap">
                        <div class="descinner"><?php echo $curauth->description; ?>
                        </div>
                        </div>
                        <?php } ?>

CAn anyone help me? Thanks

2
<?php if(!empty($curauth->description)) { ?>
   <div class="title">About me</div>
   <div class="descwrap">
       <div class="descinner">
          <?php echo $curauth->description; ?>
       </div>
   </div>
<?php } ?>

This should work for you. It checks if the variable is empty or not (http://php.net/manual/en/function.empty.php).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.