ID, 'googleplus', true); if( !empty($googleplus) ){ $sociallinks.= ''; } $twitter = get_user_meta($authordata->ID, 'twitter', true); if( !empty($twitter) ){ $sociallinks.= ''; } $facebook = get_user_meta($authordata->ID, 'facebook', true); if( !empty($facebook) ){ $sociallinks.= ''; } $link = sprintf( '' . $sociallinks, get_author_posts_url( $authordata->ID, $authordata->user_nicename ), esc_attr( sprintf( __( 'Postsss by %s' ), get_the_author() ) ), get_the_author() ); return $link; } add_filter( 'the_author_posts_link', 'AuthorSocialLinks_link', 10); /** * Adds custom contact forms to the admin user's form for users to be able to add their own information **/ function AuthorSocialLinks_profiles( $contactmethods ) { // Add Blog Title $contactmethods['blog_title'] = 'Blog Title'; // Add Google profile $contactmethods['googleplus'] = 'Google+ URL'; // Add Twitter $contactmethods['twitter'] = 'Twitter Profile URL'; //add Facebook $contactmethods['facebook'] = 'Facebook Profile URL'; return $contactmethods; } add_filter('user_contactmethods','AuthorSocialLinks_profiles',10,1); // end of adding custom fields to WP user profile ?>