/ Published in: PHP
By Shankar Dhanasekaran
On opendrops.com, 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.
On opendrops.com, 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.
URL: http://opendrops.com/blog/how-show-real-names-drupal-7