我是新来的PHP。如何添加作者图片和说明 - WordPress的
我使用作者图像小部件。 http://www.semiologic.com/software/author-image/
我使用下面的简单代码来获取作者图像。
author.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); `
感谢您的.. 我有一个看的.. 问题是下面的代码不打印作者详细.. 但它的打印笔者图像.. '\t \t \t \t <?PHP \t \t \t \t \t \t $ auth_foto = the_author_image($ AUTHORID); \t \t \t $ auth_detail = the_author_meta('description',$ authorid); \t \t \t echo $ auth_foto; \t \t \t echo $ auth_detail; \t \t \t \t \t \t \t \t?> \t \t' 什么想法? –
此方法直接将输出发送到browser.you不能像你这样将它分配给变量。试试这样<?php the_author_meta('user_email',25); ?>< –
感谢对于.. 现在下面的代码工作.. '' 但我有2位作者..这些细节应该在他们的页面下自动显示。所以作者ID必须自动分配..不是吗? 但现在所有的细节都属于用户标识1。 因此,如何更改它自动分配作者或用户ID? –