Wednesday 28 December 2016

How To Display Author Bio in WordPress

After login in WordPress login panel.


Add Social Media Profile Box To User Profile:-
Copy the below into your "functions.php" file to add input boxes for the user social media profiles.

/*=====================================================================    * Add Author Links
 * ====================================================================*/
function add_to_author_profile( $contactmethods ) {

$contactmethods['rss_url'] = 'RSS URL';
$contactmethods['google_profile'] = 'Google Profile URL';
$contactmethods['twitter_profile'] = 'Twitter Profile URL';
$contactmethods['facebook_profile'] = 'Facebook Profile URL';
$contactmethods['linkedin_profile'] = 'Linkedin Profile URL';

return $contactmethods;
}
add_filter( 'user_contactmethods', 'add_to_author_profile', 10, 1);

Then Go to Users -> Your Profile & manage information.


View Author Bio:-
Copy & paste Following code where you want so see.






Written by



Website:

    $rss_url = get_the_author_meta( 'rss_url' );
    if ( $rss_url && $rss_url != '' ) {
    echo '
  • ';
    }

    $google_profile = get_the_author_meta( 'google_profile' );
    if ( $google_profile && $google_profile != '' ) {
    echo '
  • ';
    }

    $twitter_profile = get_the_author_meta( 'twitter_profile' );
    if ( $twitter_profile && $twitter_profile != '' ) {
    echo ' ';
    }

    $facebook_profile = get_the_author_meta( 'facebook_profile' );
    if ( $facebook_profile && $facebook_profile != '' ) {
    echo ' ';
    }

    $linkedin_profile = get_the_author_meta( 'linkedin_profile' );
    if ( $linkedin_profile && $linkedin_profile != '' ) {
    echo '
  • ';
    }
    ?>




    Ankit Shah PHP Expert

    IT New Code suggest a solution for your problem related to coding, Specially .PHP, Wordpress, WooCommerce, Magento, HTML and CSS. Visit Our website for Information.

    0 comments:

    Post a Comment

     

    Copyright @ 2016 IT New Code | Developing Code | Designing Code.

    Designed by: Ankit Shah