0

I have post page with author info. But I want to show author box info only if author has description. this is what i tried to do:

<?php if ( !empty(get_the_author_meta('description')) and !empty( get_the_author_meta( 'ID' )) ):?>
    <div class="blog-article-author">
        //author info here
    </div>
<?php endif; ?>

But I get an error:

Can't use function return value in write context

for this part of code :

<?php if ( !empty(get_the_author_meta('description')) and !empty( get_the_author_meta( 'ID' )) ):?>

How to solve this problem ?

1
0

Try this one :

<?php
$authordesc = get_the_author_meta( 'description' );

if ( ! empty ( $authordesc ) ){ ?>
<div class="blog-article-author">
    //author info here...
</div>
<?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.