[WordPress] 外掛分享: WP Most Popular

WordPress 外掛 WP Most Popular 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「WP Most Popular」是 2012-01-23 上架。
  • 目前有 2000 個安裝啟用數。
  • 上一次更新是 2018-08-07,距離現在已有 2463 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.2.4 以上。
  • 有 11 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

mattgeri | wearewpgeeks |

外掛標籤

popular | most-viewed | popular posts | most viewed posts | popular posts widget |

內容簡介

WP Most Popular 是一個應付排名部落格上最熱門文章的簡單任務的插件,創建的原因是因為找不到一個好的插件而感到沮喪。

此插件根據瀏覽量記錄了您最受歡迎的文章,並允許您使用自定義樣式在您的博客主題中顯示它們。您可以顯示過去一天、7天、30天或全部時間的熱門文章。

插件還附帶一個側邊欄小工具,讓您在博客側邊欄中顯示您的受歡迎的文章。

如果您是開發人員並將插件集成到主題中,則可以獲得更多靈活性,包括顯示最受歡迎的自定義文章類型等功能。

此插件由 WP Geeks 建立和維護。有關額外的文檔、視頻、片段和支持,請訪問 WP Most Popular 產品頁面。

用法

您可以以兩種方式使用此插件。

使用側邊欄小工具
在您的主題文件中使用定制函數

使用小工具是最簡單的方法,並且建議大多數用戶使用。如果您是開發人員並想將插件集成到現有主題中,請閱讀下面的信息。

首先,您需要在主題中包含用於檢索受歡迎文章的主要功能,稱為wp_most_popular_get_popular()。

您可以將該函數作為以下數組形式的參數傳遞:

limit(整數)

您想要顯示的文章數,例如 5
默認值:5

post_type(字符串)/(數組)

您想要顯示的文章類型
例如:post
默認值:所有文章類型

range(字符串)

您想顯示熱門文章的日期範圍
接受值:all_time、monthly、weekly、daily
默認值:all_time

這些是插件支持的當前參數。現在讓我們看一個示例,該示例顯示了最近的熱門文章,內容以無序列表形式顯示。

echo '

    ';
    $posts = wp_most_popular_get_popular( array( 'limit' => 10, 'post_type' => 'post', 'range' => 'all_time' ) );
    global $post;
    if ( count( $posts ) > 0 ): foreach ( $posts as $post ):
    setup_postdata( $post );
    ?>

  • endforeach; endif;
    echo '
';
?>

過濾器

以下過濾器可供使用:

wp_most_popular_list_before - 用於過濾小工具列表中的

    元素

    wp_most_popular_list_after - 用於過濾小工具列表中的

元素
* wp_most_popular_list_item_single - 用於過濾小工具生成的列表項
操作

wp_most_popular_list_item - 用於修改列表輸出

原文外掛簡介

WP Most Popular was born out of frustration in finding a decent plugin which performs one simple task and that is to rank your most popular blog posts.
The plugin keeps a log of your most popular posts based on views and lets you display them in your blog theme with custom styling. You can display popular posts from the last day, 7 days, 30 days or all time.
It also comes with a sidebar widget to let you display your popular posts on your blogs sidebar.
If you are a developer and integrate the plugin in to a theme, you will get a lot more flexibility out of the plugin including the ability to show the most popular custom post types etc.
This plugin was built and is maintained by WP Geeks. For extra documentation, videos, snippets and support, visit the WP Most Popular product page.
Usage
There are two ways in which you can use this plugin.

As a sidebar widget
Custom function in your theme files

Using the widget is the easiest way and recommended for most users. If you are a developer and want to integrate the plugin in to your existing theme, then read the information below.
Firstly, the main function which you will need to include in your theme to fetch the popular posts is called wp_most_popular_get_popular().
You can pass that function the following parameters in array form:

limit (integer)

The number of posts you would like to display i.e. 5
Default: 5

post_type (string) / (array)

The post type you would like to display
Example: post
Default: All post types

range (string)

In what date range would you like to display popular posts in
Accepted: all_time, monthly, weekly, daily
Default: all_time

Those are the current parameters that the plugin supports. Let’s look at an example of how to display the most recent popular posts in a unordered list.
';
$posts = wp_most_popular_get_popular( array( 'limit' => 10, 'post_type' => 'post', 'range' => 'all_time' ) );
global $post;
if ( count( $posts ) > 0 ): foreach ( $posts as $post ):
setup_postdata( $post );
?>

  • ';
    ?>

    Filters
    The following filters are available to you:

    wp_most_popular_list_before – used to filter the

    element of the outputted widget list
    * **wp_most_popular_list_after** – used to filter the
    element of the outputted widget list
    * wp_most_popular_list_item_single – filters for a the list item generated by the widget
    Actions

    wp_most_popular_list_item – used for modifying the list output

    各版本下載點

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

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


    0.1 | 0.2 | 0.3 | 0.3.1 | trunk |

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

    • Recently viewed and most viewed products 》「最近瀏覽過及最多瀏覽產品」是一個額外功能,允許商家在產品詳細頁上顯示「最近瀏覽過的產品」和「最多瀏覽產品」,也可以透過加入特定短碼在網站的任何位...。
    • Popular Widget 》這是一個簡單的熱門文章 WordPress 小工具,可用於您的部落格。添加日期範圍以指定何時的文章被視為熱門,預設為 365 天(一年),您也可以按類別篩選文章。...。
    • Popular Posts 》Popular Posts 外掛能夠顯示您部落格中最瀏覽的文章的列表。您可以在許多方面自訂輸出。, 此外掛需要最新版本的 Post-Plugin Library:立即下載。, 版本歷史,...。
    • WooCommerce Most Viewed Products 》這個外掛可以按照查閱次數排序顯示 WooCommerce 的產品。, , 最受歡迎產品小工具會顯示最受歡迎的產品清單。, 此外也提供了一個快速碼[wcmvp]和 [wcmvp produ...。
    • Most Viewed Products for WooCommerce 》這款 WordPress 外掛可以按照瀏覽次數排序 WooCommerce 商品,並在後台及前端展示瀏覽次數最高的商品清單。, Most Viewed Products for WooCommerce 提供了以...。
    • WebMFT: Plugin SEO useful 》新版本 1.8 啟動!加入 GoTo(隱藏外部連結)功能!, 計算文章或稅項的訪問量。, 外掛提供 3 個小工具:上一篇文章(從縮圖中取得圖片)、下一篇文章、最多瀏...。
    • cool Popular Post 》這是一個易於使用的 WordPress 函數,可以將熱門文章列表添加到任何 WordPress 主題上。您也可以使用簡碼 [cool_popular_posts] 或小工具將列表包含在文章中。。
    • TopPosts for Google Analytics 》總結:TopPosts for Google Analytics 是一個讓您輕鬆取得並展示您網站上最受歡迎的文章,並基於您網站的分析數據。請連結您的網站與 GA 屬性,使用 GATopPos...。

    文章
    Filter
    Apply Filters
    Mastodon