Displaying custom profile fields using Mingle
-
Okay, so I am using the Mingle plugin to add some networking functionality for a website I am creating for a client. I am having Mingle handle displaying user profiles and friends, but WordPress to actually register users and put in fields.
Mingle has the ability to add custom fields (ex: Twitter, Facebook, etc). However, there is now way to display these custom fields individually. So I have added my own custom fields to WordPress using the functions.php file:
/* Add Profile Fields */ function add_new_contactmethods($methods){ $methods['twitter'] = 'Twitter'; return $methods; } add_filter('user_contactmethods','add_new_contactmethods');
and am displaying them within one of the Mingle templates (mingle/classes/views/mngl-profiles/profile.php).
Here is the code I am using to display them:
<?php if ( get_the_author_meta( 'twitter' ) ) { ?> <a href="https://twitter.com/<?php the_author_meta( 'twitter' ); ?>" title="Follow @<?php the_author_meta( 'twitter' ); ?> on Twitter"> <div class="tile bg-color-twitter icon"> <div class="tile-content"> <img src="<?php echo THEME_DIR; ?>/images/icons/twitter.png" alt="Twitter" class="socialIcon" /> </div> <div class="brand"> <span class="name">@<?php the_author_meta( 'twitter' ); ?></span> </div> </div><!-- .tile --> </a> <?php } ?>
Now whenever I go to a profile page that is generated by mingle, (https://website.com/admin or https://website.com/dylan), whoever is currently logged in at the moment will have their custom fields shown, not to the user whose profile is being shown.
Does that make sense? I can provide more code or elaborate if need be. I would really, really appreciate any and all help I can receive on this, the project is really time-sensitive.
Thanks,
Keenan
- The topic ‘Displaying custom profile fields using Mingle’ is closed to new replies.