[WordPress] 外掛分享: Author Categories

前言介紹

  • 這款 WordPress 外掛「Author Categories」是 2009-04-10 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2009-04-11,距離現在已有 5868 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

kdiweb |

外掛標籤

menu | author | categories | post count |

內容簡介

許多人在部落格上使用 WordPress,且許多網站上有不止一位作者。令人驚訝的是,WordPress 沒有直接支援每位作者個別的分類目錄。

我在網上為了個人需要尋找這個功能,但在任何外掛中都找不到它。確切地說,我使用了一個修改版的另一個類似的外掛,但在 WordPress 的版本 2.3 中,資料庫結構改變後,它就停止運作了。

在我看來,修復舊的、不推薦使用的(並且非常雜亂)代碼並不值得,而且沒有其他解決方案,所以我決定創建一個新的外掛程式。幸運的是,新的資料庫和 API 讓它如我所愿的那麼容易。

最終我使用這個外掛程式,它是作為預設分類目錄的包裝器而創建的。

它很輕量且易於插入和拔除。此外,作為預設分類目錄的擴展,意味著所有功能(排序、帖子計數等)都不會丟失。事實上,它可以輕鬆擴展,而且可以支持未來幾年的部落格平台版本。

用法很簡單,只需在管理面板中上傳和啟用外掛程式,然後調用自定義函數 wp_author_categories(),它會為您創建作者的選單。注意,這僅在作者頁面上有效,在其他情況下會恢復為預設分類目錄。

如果您使用預設模板,您可以輕鬆地在「sidebar.php」中找到顯示分類目錄的這一行:
< ?php wp_list_categories('show_count=1&title_li=Categories’); ?>

您可以將其替換為此條件,當您訪問作者頁面時將使用 wp_author_categories() 函數代替:
/*
* 首先,寫下您想用於您的選單的參數,並將其存儲在一個變量中。
* 這些選項對於默認選單 ("wp_list_categories") 和作者選單 ("wp_author_categories") 相同。
* 您可以在此處找到有關您可以使用哪些選項的更多信息:https://codex.wordpress.org/Template_Tags/wp_list_categories。
*/
$args = 'show_count=1&title_li=

Categories

';
if($author){
wp_author_categories($args);
} else{
wp_list_categories($args);
}
?>

此外,如果您的模板文件夾中已經有一個「author.php」文件,您可以將「wp_list_categories()」簡單地重命名為「wp_author_categories()」並傳遞相同的參數。

要卸載,只需逆向操作即可。從您的模板文件中刪除 wp_author_categories() 函數的所有引用,然後通過 WordPress 的管理面板卸載外掛程式。

授權條款基於 GNU 通用公共許可證:
http://www.gnu.org/licenses/gpl-2.0.txt

原文外掛簡介

Numerous people are using WordPress for blogging and in many cases there are more than one authors on a website. It’s uncomfortably surprising that WordPress doesn’t support out of the box a category menu for each author separately.
I was looking for this feature online for my personal need but couldn’t find it on any plugin. To be exact I was using a modified version of another similar plugin but that was until version 2.3 where the database structure changed for WordPress and it simply stopped working.
As I saw it, it wasn’t worth fixing old, deprecated (and highly cluttered) code, and there weren’t any other solutions out there, so I decided to create a new plugin. Thankfully the new database and API made it as easy as I had hoped for.
I ended up with this plugin, that was created as a wrapper of the default category menu.
It is lightweight and can easily plug-in, plug-out. Furthermore, being an extension of the default category menu, means that none of the functionality (sorting, post count etc.) is lost. In fact it can be easily extended and could support future versions of the blogging platform for years to come.
Usage
After you upload an activate the plugin through your admin panel, all you need to do is call the custom function wp_author_categories() that will create an author’s menu for you. Notice that this only works in author pages and will revert to the default category menu in any other case.
If you are using the default template, you can easily find this line in “sidebar.php” (that displays the category menu):

You can replace it with this condition that will use the wp_author_categories() function instead, when you are visiting the author pages
Categories

';
if($author){
wp_author_categories($args);
} else{
wp_list_categories($args);
}
?>

Alternatively, and if you already have an “author.php” file in your template folder, you can simply rename “wp_list_categories()” to “wp_author_categories()”, passing the same arguments.
To uninstall, it’s as easy as doing the reverse actions. Delete all references of the wp_author_categories() function from your template files and uninstall the plugin through that WordPress’s admin panel.
License
This work is released under the terms of the GNU General Public License:
http://www.gnu.org/licenses/gpl-2.0.txt

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Author Categories」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | trunk |

延伸相關外掛(你可能也想知道)

  • Post View Count 》「Post View Count」是一個易於使用且輕量級的文章瀏覽次數外掛,它允許您顯示某種文章類型的瀏覽次數。, 主要功能, , 輕量級外掛, 無需第三方依賴, 文章瀏覽...。
  • Easy Post Views Count 》Easy Post Views Count 是一個易於使用、輕量級的文章瀏覽次數插件,可讓您顯示文章、頁面或自訂文章類型的瀏覽次數。, 主要特色, , 輕量級插件, 無第三方相...。
  • User Stats 》User Stats 提供一個簡單的方式,讓您可以一目了然地查看有關您的使用者的統計資訊,包括:發佈文章數量、文章瀏覽量、文章成本、每 1000 次瀏覽的成本等等。。
  • Counter Widget 》這個小工具可以顯示您網站上的文章數、分類數、評論數和使用者數。。
  • Custom Post Type Filters For Users Insights 》擴充Users Insights 外掛程式預設的使用者文章活動功能。, Users Insights 外掛程式預設提供每個使用者所建立的文章總數,包括頁面和任何自訂文章類型。然而...。
  • Post Count Tracker 》以下是該WordPress外掛的摘要資訊:, - 外掛在每篇文章的內容末端新增了文章計數。, - 這有助於您追踪網站上的文章觀看次數,對管理員和讀者都很有用。, - 安...。
  • Users Custom Posts Counts 》這是一個基本的 WordPress 外掛,它會在使用者清單表格上新增一個欄位,顯示特定自訂文章類型的文章數量。這個功能跟使用者清單上的文章數欄位一樣。。
  • Post View Count Editor 》在文章編輯頁面添加一個 Metabox,顯示當前文章的瀏覽次數並讓您更新該值。。
  • Network Sites Counts Dashboard Widget 》啟用後,此外掛會在網路管理員控制台頁面上新增一個儀表板小工具,顯示所有網站及其已發佈和草稿文章的列表。您可以透過添加 post_type 查詢參數,查看其他文...。
  • Quick-Insight 》總結:Quick-Insight 是一個方便的 WordPress 外掛,旨在讓您快速瞭解網站的主要信息。它顯示活動主題名稱、帖子和發佈頁面的總數,並詳細查看存儲使用情況,...。
  • Webpage View Count 》這個外掛可以讓你顯示一篇文章、頁面或自訂文章型別已經被瀏覽了多少次。
  • Universal Post Counter 》UNIVERSAL POST COUNTER, Universal Post Counter 是 PressTigers 開發的一個簡單插件。它允許管理員在管理儀表板中查看所有文章類型的快速統計數據,以儀表...。
  • Bubuku post view count 》這個外掛可以讓你輕鬆查看一篇文章的點擊次數。它只在文章和一些時間後的端點處運行,因此不會影響 CWV,而且頁面加載速度很快。, 我們存儲值的文章meta是 "v...。
  • Author Performance 》Author Performance 是一個評估作者表現的小型外掛程式,適用於社群網誌。Author Performance 提供作者撰寫的文章字數、文章數量以及最長的文章等簡要資訊。。
  • Admins Post Statistics 》這個外掛允許你追蹤每篇文章的瀏覽次數, 它在管理區的文章表格中加入了一列視圖數據, 同時限制文章表格中只顯示管理員、作者和編輯所發表的文章, 它還在「文...。

文章
Filter
Apply Filters
Mastodon