前言介紹
- 這款 WordPress 外掛「Author Image(s)」是 2005-04-13 上架。
- 目前有 80 個安裝啟用數。
- 上一次更新是 2012-01-04,距離現在已有 4874 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.1 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
image | author | avatar | widget | authors |
內容簡介
本外掛可顯示文章作者的圖像(若有)和/或名稱,或是網誌上所有作者的資訊。您可以在 index.php(以及其他文章範本)中使用 來顯示文章作者的圖像(置於「迴圈」內),以替代 或 。您可以在網誌的側邊欄使用 以替代 來列出所有作者的圖像和/或名稱。此外,本外掛還提供了簡單的小工具列出作者。當尋找圖像和/或名稱時,流程如下:
若帖子定義了「作者圖像」自訂欄位,則外掛會檢查其值是否是已定義圖像目錄中有效的圖像名稱。如果不是,則逐一加入定義圖像副檔名,然後檢查圖像能否被找到。
如果目前尚未找到任何圖像,則外掛會在圖像目錄中尋找以作者登入名稱命名且副檔名符合定義圖像副檔名之檔案。
如果目前尚未找到任何圖像,則外掛會在圖像目錄中尋找以作者 ID 命名且副檔名符合定義圖像副檔名之檔案。
如果目前尚未找到任何圖像,且啟用了 Gravatar 支援,則請求 Gravatar 提供與作者相關聯的頭像(基於作者的電子郵件地址)。
如果目前尚未找到任何圖像,且定義了空白/一般圖像,則將其作為作者頭像使用。
如果找到圖像,且「也顯示作者名稱?」設定為 true,或者未找到作者圖像且「若有找到作者圖像則顯示作者名稱?」設定為 true,則會附加/使用作者名稱。
其他注意事項:
外掛的管理選項頁面可讓您控制作者名稱是否應該與作者圖像一同顯示,如果未找到作者圖像是否仍需顯示作者名稱、圖像目錄、支援的圖像副檔名,以及您想要哪些作者圖像連結到哪裡。
由 c2c_the_author_image() 輸出的圖像定義為 class=”author_image”,供樣式表操作。
由 c2c_wp_list_authors_images() 輸出的圖像定義為 class=”list_author_image”,供樣式表操作。
技巧提示: 您可以利用 $image_dir 參數在不同情境下顯示不同的作者圖像,例如將圖像放在不同的目錄中「wp-content/images/authors/small/」和「wp-content/images/authors/large/」,然後根據情境決定從哪裡獲取圖像。更多資訊請參閱本外掛的網站、WordPress 外掛目錄和作者主頁。本外掛提供三個可選的模板標籤供您在佈景模板中使用。
原文外掛簡介
Display image (if present) and/or name for the author of a post, or for all authors on the blog.
Use as a replacement for or in index.php (and/or any other post templates) to display an image for a post’s author (inside “the loop”)
Use as a replacement for in the sidebar section of your site to list all authors for the blog using an image and/or text.
The plugin also provides a simple widget for listing authors.
Process by which the image is located and/or text used:
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. 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.
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.
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.
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).
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.
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?” setting is true, then the author’s name is appended/used.
Additional notes:
The plugins admin options page allows you to control if the author’s name should appear alongside the author image or not, if the author name should be shown in the event no author image could be found, the image directory, the support image extensions, and if and what you want the author image to link to.
Images output by c2c_the_author_image() are defined with class=”author_image” for stylesheet manipulation
Images output by c2c_wp_list_authors_images() are defined with class=”list_author_image” for stylesheet manipulation
Tip:: You can take advantage of the $image_dir argument to display different author images under different contexts, i.e. locate your images in different directories ‘wp-content/images/authors/small/’ and ‘wp-content/images/authors/large/’ and decide on context where to get the image(s) from.
Links: Plugin Homepage | Plugin Directory Page | Author Homepage
Template Tags
The plugin provides three optional template tags for use in your theme templates.
Functions
function c2c_get_author_image( $args = array() )
Gets the image and/or name for an author.
function c2c_the_author_image( $before = '', $after = '', $image_dir = '', $width = '', $height = '' )
A drop-in replacement for WordPress’s the_author() , allowing the author for the post to have an image displayed in lieu of the name (if an image can be found).
function c2c_wp_list_authors_images( $args = '' )
A drop-in replacement for WordPress’s wp_list_authors(), allowing all authors for a blog to be listed with an image (if present).
This displays the image associated with a post’s categories.
Arguments
$before
Optional argument. The text and/or HTML to appear before the author image/text, if any such text would be returned.
$after
Optional argument. The text and/or HTML to appear after the author image/text, if any such text would be returned.
$image_dir
Optional argument. The directory, relative to the root of your blog, in which to find the author images. If not set, it defaults to the value configured via the plugin’s admin options page.
$width
Optional argument. The forced width of the image (will cause browser to resize if image is of different width). Leave blank to retain image’s original width (or for the width to be scaled in proportion to a specified height). It is recommended that images exist at the desired size.
$height
Optional argument. The forced height of the image (will cause browser to resize if image is of different height). Leave blank to retain image’s original height (or for the height to be scaled in proportion to a specified width). It is recommended that images exist at the desired size.
$author_id
Optional argument. The id of the author. If null, then gets the author for the current post. Default is null.
$args (as used in c2c_get_author_image())
Optional argument. An array of configuration options.
author_id : default of current post author; the id of the author to get the image for
before : default of ”; text to show before each author
after : default of ”; text to show after each author
image_dir : default of ”; directory containing author images, relative to wp-content directory
width : default of ”; width to display image
height : default of ”; height to display image
show_name : default of ” which means it’ll abide by the plugin’s setting value; should the name of the author be shown in addition to the image?
show_fullname : default of false; should the user’s first and last name be shown instead of the author’s configured display name? (be sure to set ‘show_name’ to true if you want the name to appear in the first place)
show_name_if_no_image : default of ” which means it’ll abide by the plugin’s setting value; should the author’s name be shown if the author doesn’t have an image?
class : default of ”; array or string of classes to apply to author image tag
use_gravatar : default of plugin settings; should Gravatar be consulted for an author image if no local image for the author was found?
$args (as used in c2c_wp_list_authors_images)
Optional argument. An array of configuration options. All but the last two match up with the supported arguments of the wp_list_authors() function.
optioncount : default of false;
exclude_admin : default of true; should the admin user be excluded from the listing?
hide_empty : default of true; should authors who have not made any posts be excluded from the listings?
feed : default of ”
feed_image : default of ”
echo : default of true; should the listing be echoed to the page?
show_name : default of ” which means it’ll abide by the plugin’s setting value; should the name of the author be shown in addition to the image?
show_fullname : default of false; should the user’s first and last name be shown instead of the author’s configured display name? (be sure to set ‘show_name’ to true if you want the name to appear in the first place)
show_name_if_no_image : default of '' which means it’ll abide by the plugin’s setting value; should the author’s name be shown if the author doesn’t have an image?
before : default of ”; text to show before each author
after : default of ”; text to show after each author
image_dir : default of ”; directory containing author images, relative to wp-content directory
width : default of ”; width to display image
height : default of ”; height to display image
class : default of ”; array or string of classes to apply to author image tag
use_gravatar : default of plugin settings; should Gravatar be consulted for an author image if no local image for the author was found?
Examples
Show the author image for the current post’s author (must be “in the loop”)
Get the author image from a different directory when on a post’s permalink page (for instance, show a larger image on the permalink page)
List all authors in the sidebar
Change some default options when listing authors
false, ‘show_name_if_no_image’ => true)); ?>
Filters
The plugin exposes two filters and two actions for hooking. Typically, customizations utilizing these hooks would be put into your active theme’s functions.php file, or used by another plugin.
c2c_get_author_image (filter)
The ‘c2c_get_author_image’ hook allows you to use an alternative approach to safely invoke c2c_get_author_image() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Arguments:
same as for c2c_get_author_image()
Example:
Instead of:
false ) ); ?>
Do:
false ) ); ?>
c2c_get_the_author_image (filter)
The ‘c2c_get_the_author_image’ hook allows you to use an alternative approach to safely invoke c2c_get_the_author_image() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Arguments:
same as for c2c_get_the_author_image()
Example:
Instead of:
Do:
c2c_the_author_image (action)
The ‘c2c_the_author_image’ hook allows you to use an alternative approach to safely invoke c2c_the_author_image() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Arguments:
same as for c2c_the_author_image()
Example:
Instead of:
', '', '/images' ); ?>
Do:
', '', '/images' ); ?>
c2c_wp_list_authors_images (action)
The ‘c2c_wp_list_authors_images’ hook allows you to use an alternative approach to safely invoke c2c_wp_list_authors_images() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Arguments:
same as for c2c_wp_list_authors_images()
Example:
Instead of:
false ) ); ?>
Do:
false ) ); ?>
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Author Image(s)」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
2.0 | 3.0 | 3.5 | 3.6 | 3.5.1 | 3.5.2 | trunk |
延伸相關外掛(你可能也想知道)
Widgets for Google Reviews 》onal version of our review software, you can:, , , Display unlimited Google Reviews, Customize widget design and behavior, Respond to reviews direc...。
Blocksy Companion 》Blocksy Companion 是一個外掛,將 Blocksy 主題轉化為強大的瑞士軍刀工具。, 只有在安裝並啟用 Blocksy 主題時,它才會運行並添加增強功能。, 最小需求, , W...。
Black Studio TinyMCE Widget 》此外掛添加了一個新的 Visual Editor 小工具類型,讓您能夠在側邊欄中輕鬆地插入豐富的文字和媒體對象。使用 Black Studio TinyMCE Widget 時,您將能夠使用W...。
Widget Importer & Exporter 》Widget Importer & Exporter 是一個有用的外掛,可將小工具從一個WordPress站點移動到另一個站點,備份小工具,並供主題開發人員為用戶提供範例小工具。...。
Orbit Fox by ThemeIsle 》透過Orbit Fox,您可以使用各種模組擴充您的主題功能,例如社交媒體分享按鈕和圖示、自訂選單圖示、頁首和頁尾腳本、一鍵導入頁面模板、頁面建構器附加元件和...。
Recent Posts Widget With Thumbnails 》列出最新的文章標題、縮略圖、摘要、作者、類別、日期等等!, 雖然此外掛僅建立在小工具區域,但使用者報告說它在 Elementor 和 Oxygen 上運作順暢。但它是否...。
WordPress Popular Posts 》WordPress Popular Posts 是一個高度可定製的小工具,可以顯示您最受歡迎的文章。, 主要特點, , 多小工具功能 – 您可以在您的博客上擁有多個 WordPress...。
Widget Logic 》此外掛可在每個小工具中新增一個名為 "Widget logic" 的額外控制欄,讓您控制這個小工具會出現在哪些頁面上。文字欄位允許您使用 WP 的Conditional Tags或任...。
Social Media Share Buttons & Social Sharing Icons 》在你的免費測試網站上試試看:點擊此處 => https://tastewp.com/plugins/ultimate-social-media-icons, (這個技巧適用於所有外掛 – 只需在外掛的 WP 存儲庫 ...。
Fixed Widget and Sticky Elements for WordPress 》使用 Fixed Widget 外掛可以創建黏貼式的小部件、區塊和其他元素,當用戶向上或向下滾動頁面時,它們會保持在可見的屏幕區域內。, 相較於非固定小工具,黏貼...。
PHP Code Widget 》普通的文字小工具允許您插入任意文字和/或 HTML 代碼。這個外掛程式也允許這樣做,但還會解析文本小工具中的任何 PHP 代碼並執行它。, 這可以讓您更輕鬆地遷...。
Image Widget 》Image Widget 是一個簡單的外掛程式,利用 WordPress 原生媒體管理員,為您的網站新增圖片小工具。, 需要新增幻燈片、燈箱或隨機圖像嗎?, 請查看 Image Widg...。
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager 》使用 Custom Sidebars,一個靈活的小工具管理器,在您的網站上管理和替換側邊欄和其他小工具區。, 製作自訂側邊欄配置,能夠選擇在您網站的每個頁面或文章上...。
Recent Posts Widget Extended 》外掛描述, 此外掛可以啟用自定義、靈活且進階的最新文章功能,您可以透過簡碼或小工具來顯示它。您可以顯示具有縮略圖、摘要和發佈日期的最新文章清單,並且...。
Widget Shortcode 》這個短碼需要小工具的ID,但不需要猜測,外掛會為你生成代碼。如果你想要覆蓋小工具的標題,你可以使用 "title" 參數:, [widget id=”text-1″...。