Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted
<?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).

share|improve this answer
    
Thankyou.... :) –  Giri Dec 27 '11 at 2:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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