nazwa użytkownika / user name
<?php global $post; $author_id=$post->post_author; ?> <?php the_author_meta( 'first_name', $author_id ); ?> <?php the_author_meta( 'last_name', $author_id ); ?> <?php the_author_meta( 'description', $author_id ); ?>
lista parametrów:
- user_login
- user_pass
- user_nicename
- user_email
- user_url
- user_registered
- user_activation_key
- user_status
- roles
- display_name
- nickname
- first_name
- last_name
- description (Biographical Info from the user’s profile)
- jabber
- aim
- yim
- googleplus
- user_level
- user_firstname
- user_lastname
- rich_editing
- comment_shortcuts
- admin_color
- plugins_per_page
- plugins_last_view
- ID
<?php global $post; $author_id=$post->post_author; ?> <img src="<?php the_field('avatar','user_'.$author_id); ?>" class="author_icon" alt="Avatar"> <h6 class="post-author"><?php the_author_meta( 'first_name', $author_id ); ?> <?php the_author_meta( 'last_name', $author_id ); ?></h6> <?php $id = get_the_author_id(); ?> <h6 class="post-author"><?php the_author_meta( 'first_name', $id ); ?> <?php the_author_meta( 'last_name', $id ); ?></h6> <img src="<?php the_field('avatar','user_'.$id); ?>" alt="Avatar">
—
<?php $first_name = the_author_meta( 'first_name', $author_id ); ?> <?php $last_name = the_author_meta( 'last_name', $author_id ); ?> <?php if (($first_name !== "") && ($last_name !== "")): ?> <h4><?php echo $first_name; ?> <?php echo$last_name; ?></h4> <?php else: ?> <h4><?php the_author_meta( 'user_login', $author_id ); ?></h4> <?php endif; ?> <p><?php the_author_meta( 'description', $author_id ); ?></p> <?php $user_info = get_userdata(2); echo 'Username: ' . $user_info->user_login . "\n"; echo 'User roles: ' . implode(', ', $user_info->roles) . "\n"; echo 'User ID: ' . $user_info->ID . "\n"; ?>
—
Hope this helps and happy coding :)