WordPress Development
How to get wordpress author information
To get wordpress author information in your theme need to use below function.
<?php the_author(); ?> <?php echo get_avatar( get_the_author_email(), 'size here' ); ?> <?php echo the_author_link(); ?> <?php the_author_posts_link(); ?> <?php the_author_meta( $field, $userID ); ?> <?php the_author_meta('social'); ?> <?php the_author_description(); ?> <?php echo date("D M Y", strtotime(get_userdata(get_current_user_id( ))->user_registered)); ?>
Line-1: To get wordpress author name.
Line-2: To get wordpress author avatar image.
Line-3: To get wordpress author name with link.
Line-4: To get wordpress author post link.
Line-5: To get wordpress author meta. In field can use: user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name, nickname, first_name, last_name, description, jabber, aim, yim, user_level, user_firstname, user_lastname, user_description, rich_editing, comment_shortcuts, admin_color, plugins_per_page, plugins_last_view, ID .
Line-6: To get wordpress author meta Aim. This is an example to get meta.
Line-7: To get wordpress Author bio information.
Line-8: To get wordpress author joining date.
To add more social link just below function in your wordpress theme functions.php file.
function my_new_contactmethods( $contactmethods ) { // Add Twitter $contactmethods['twitter'] = 'Twitter'; //add Facebook $contactmethods['facebook'] = 'Facebook'; //here can be add more return $contactmethods; } add_filter('user_contactmethods','my_new_contactmethods',10,1);
Comments are closed