The MU forums have moved to WordPress.org

User profile info (7 posts)

  1. denzel2364
    Member
    Posted 13 years ago #

    Hi all,
    I was wondering why this doesnt work in wordpress mu?

    Add this to functions.php

    <?php
    function my_new_contactmethods( $contactmethods ) {
      // Add Twitter
      $contactmethods['twitter'] = 'Twitter';
      //add Facebook
      $contactmethods['facebook'] = 'Facebook';
    
      return $contactmethods;
    }
    add_filter('user_contactmethods','my_new_contactmethods',10,1);
    ?>

    And then this goes into the template:

    <?php
    the_author_meta('facebook', $current_author->ID)
    ?>
  2. andrea_r
    Moderator
    Posted 13 years ago #

    It should work just dandy.

  3. denzel2364
    Member
    Posted 13 years ago #

    the options appear in the profile section in wp-admin. but it doesnt show on the front end of the site. :-(

  4. denzel2364
    Member
    Posted 13 years ago #

    just to note, I have the latest version installed

  5. andrea_r
    Moderator
    Posted 13 years ago #

    Where did you put it in the template?

  6. dsader
    Member
    Posted 13 years ago #

    Wouldn't the following work to echo author facebook meta?

    <?php echo $current_author->facebook; ?>

  7. andrea_r
    Moderator
    Posted 13 years ago #

    Something liek this:

    <?php if ( get_the_author_meta( 'twitter' ) ) { ?>
    			<p class="twitter clear">
    				<a href="http://twitter.com/<?php the_author_meta( 'twitter' ); ?>" title="Follow <?php the_author_meta( 'display_name' ); ?> on Twitter">Follow <?php the_author_meta( 'display_name' ); ?> on Twitter</a>
    			</p>
    		<?php } // End check for twitter ?>

    via http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

About this Topic

  • Started 13 years ago by denzel2364
  • Latest reply from andrea_r