0

I have post page with author info. But it seems author bio box should only display if content has been entered. How to check it?

<?php if(get_avatar( get_the_author_meta( 'ID' )) != 0){
    echo get_avatar( get_the_author_meta( 'ID' ) , 80);
}?>
<div class="post-full-desc">
    <h6><?php the_author_posts_link(); ?></h6>
    <p><?php echo get_the_author_meta('description')?></p>
</div>

1 Answer 1

0
    if( !empty(get_the_author_meta('description')) ){
       echo get_the_author_meta('description');
    }

You can use empty() function to check the content entered or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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