How to show Real Names in Drupal 7

/ Published in: PHP
Save to your folder(s)

By Shankar Dhanasekaran
On, I wanted to show myreal name for all my posts in the submitted information instead of my username. In D6, one could do this with the wonderful module RealName. However, there is no D7 version as of now. Nevertheless, the logic behind showing the realname is not so much complicated. Here is how I did it.

1. I created a new field for user object with the system name real_name.
2. Used the below code in my theme's template.php. (My theme name is krish, and you would want to change the function name below to indicate your themename, otherwise, this wont work.)
3. Clear cache.


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.