我是 php 新手。
我使用作者图像小部件。 http://www.semiologic.com/software/author-image/
我使用以下简单代码来获取作者图像。
作者.php:
$auth_foto = the_author_image($authorid);
echo $auth_foto;
它工作正常。它显示了作者的形象。
现在我想在图片下方显示作者描述和他的帖子标题?我怎样才能做到这一点?
我试过<?php the_author_meta( 'description' ); ?>
了,但它不起作用。
提前致谢。
解决方案 当我使用以下代码时,它现在工作正常。
`
$author_id=$post->post_author;
$auth_foto = the_author_image($author_id);
function auth_desc ($author_id) {
echo the_author_meta('display_name', $author_id).'<br/>';
echo get_the_author_meta('user_email', $author_id).'<br/>';
echo the_author_meta( 'description', $author_id).'<br/>'.'<br/>'.'<br/>';
}
echo $auth_foto; auth_desc($author_id); `