Display image (if present) and/or name for the author of a post, or for all authors on the blog.
显示帖子作者或博客上所有作者的图像(如果有)和/或名称。 p>
Use 使用 <?php c2c_the_author_image(); ?>
as a replacement for
or ?> code>替代 <?php the_author()?> code>或 <?php get_avatar(); ?>
in index.php (and/or any other post templates) to display an image for a post’s author (inside “the loop”)
?> code>在index.php(和/或任何其他帖子模板)中显示帖子作者的图片(在“循环”中) p>
Use 使用 <?php c2c_wp_list_authors_images(); ?>
as a replacement for ?> code>代替 <?php wp_list_authors();?>
in the sidebar section of your site to list all authors for the blog using an image and/or text.
网站侧边栏部分的?> code>,以使用图像和/或文本列出博客的所有作者。 p>
The plugin also provides a simple widget for listing authors.
该插件还提供了一个用于列出作者的简单小部件。 p>
Process by which the image is located and/or text used:
定位图像和/或使用文字的过程: p>
- If a post has an ‘author_image’ custom field defined, the plugin checks if the value is the valid name of an image in the defined image directory.
- 如果帖子中定义了“ author_image”自定义字段,则插件会检查该值是否为已定义图像目录中图像的有效名称。
If not, it appends each of the defined image extensions, in turn, to the custom field’s value, then checks if an image can be found.
如果没有,它将依次将每个定义的图像扩展名附加到自定义字段的值,然后检查是否可以找到图像。 li>
- If no image has been found yet, it looks in the image directory for a file with a name that is the author’s login name with a file extension matching one of the ones defined in image extensions.
- 如果尚未找到图像,它将在图像目录中查找名称为作者登录名且文件扩展名与图像扩展名定义的文件名匹配的文件。 li>
- If no image has been found yet, it looks in the image directory for a file with a name that is the author’s ID with a file extension matching one of the ones defined in image extensions.
- 如果尚未找到图像,它将在图像目录中查找名称为作者ID且文件扩展名与图像扩展名中定义的文件之一匹配的文件。 li>
- If no image has been found yet and Gravatar support is enabled, it then asks Gravatar for the avatar associated with the author (based on author’s email address).
- 如果尚未找到图片并且启用了Gravatar支持,则会向Gravatar询问与作者关联的头像(基于作者的电子邮件地址)。 li>
- If no image has been found yet and a blank/generic image has been defined, then the blank image is used as the author’s avatar.
- 如果尚未找到图片并且定义了空白/通用图片,则将空白图片用作作者的头像。 li>
- If an image has been found and the “Show author name as well?”
- 如果找到了图像,并且“还显示作者姓名?”
setting is true, or if no author image has been found and “Show author name if image is found?”
设置为true,或者找不到作者图像,并且显示“如果找到图像则显示作者名称?”
setting is true, then the author’s name is appended/used.
设置为true,然后会附加/使用作者的姓名。 li>
ol>
Additional notes:
其他说明: p>
ul>
Tip:: You can take advantage of the $image_dir argument to display different author images under different contexts, ie locate your images in different directories 'wp-content/images/authors/small/' and 'wp-content/images
提示::您可以利用$ image_dir参数在不同的上下文中显示不同的作者图像,即,将图像放置在“ wp-content / images / authors / small /”和“ wp-content / images”的不同目录中
/authors/large/' and decide on context where to get the image(s) from.
/ authors / large /',并确定从何处获取图像的上下文。 p>
Links: Plugin Homepage |
链接:插件主页 |
Plugin Directory Page |
插件目录页面 |
Author Homepage
作者主页 p>
Template Tags
模板标签 h3>
The plugin provides three optional template tags for use in your theme templates.
该插件提供了三个可选模板标签,供您在主题模板中使用。 p>
Functions
功能 h4>