How to assign the_author_description to variable
-
Is there a way to assign the author’s description to a variable in order to output an “About the Author” section if it is not empty?
I’ve got this far:
<?php $userdata = get_userdata(1); ?> <?php if ($userdata->description != '') { ?> <h2>About the Author</h2> <p><?php _e($userdata->description); ?></p> <?php } ?>
But can’t find a way to get the author_id within the loop in order to pass it to the get_userdata function.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to assign the_author_description to variable’ is closed to new replies.