Show info author in single.php

This topic contains 5 reply and 2 voices, and was last updated by creatius 10 years, 11 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
May 24, 2013 at 1:52 pm 4147
creatius Hello, I want to show user registration information in the file single.php. I tried with the following code but it shows nothing. example: in single.php <?php echo the_author_meta('metaname'); ?> Thanks
May 24, 2013 at 6:32 pm 4153
Tareq Hasan Tareq Hasan

You’ve already opened a similar topic, so why create another topic? and what I asked you didn’t give me clear information.

As you want to show it on single.php, the author id can be get by $post->post_author. So echo get_user_meta( 'meta_key', $post->post_author, true ); should do the job.

May 24, 2013 at 6:48 pm 4155
creatius creatius

Sorry, I did not want to confuse the request. I just tested the code but does not work.

May 24, 2013 at 6:53 pm 4156
creatius creatius

Solved, I just did it with the following code:

$user_info = get_userdata($post->post_author);

$phone = $user_info->phone;
 echo &phone;

Thanks, I just need to fix the map in the author.php

May 24, 2013 at 7:12 pm 4157
Tareq Hasan Tareq Hasan

Are you using any custom or premium theme? Please check it in twentytwelve theme with other plugins deactivated. Seems like someone messing with the global varibales.

May 24, 2013 at 7:18 pm 4158
creatius creatius

Now I’m testing with twentytwelve.

Viewing 5 Posts - 1 through 5 (of 5 total)