這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Post Ranking View

描述

This plugin generates a list of more pupulares posts based on the number of visits the post received. The plugin uses cookies to ensure that the user’s visit is counted only once in each post, making the manipulation of the ranking.

You can set how many posts will be displayed in the ranking set that only posts from a particular CPT or a particular category will be taken into consideration, among other settings.

Contribute

You can contribute to the source code in our GitHub page.

安裝

To install just follow the installation steps of most WordPress plugin’s:

e.g.

  1. Download the file lb-back-to-top.zip;
  2. Unzip the file on your computer;
  3. Upload folder post-ranking-view, you just unzip to /wp-content/plugins/ directory;
  4. Activate the plugin through the Plugins menu in WordPress;
  5. Be happy.

Showing the ranking of posts

To display a list of posts you have two options:

1 – Let the plugin generate the HTML

2 – Save an array with the data in a variable

Parameters of the function

<?php
    displayRanking( $amount, $post_type, $category, $print, $thumb );

    $amount - Amount of posts to be displayed. Default = 5
    $post_type - Type of post that should be considered in the ranking, if not set all kind of posts will enter the ranking. Default = null
    $category - Category that should be considered in the ranking, if not set posts from all categories will enter the ranking. Default = null
    $print - Sets whether HTML is returned or an array with the posts ranking. Default = null ( display HTML )
    $thumb - Show thumbnail or not - true to display thumbnail, default false
?>

常見問題

How do I change the look of the list of posts?

The plugin does not bring any CSS style for the list of posts, the visual follows the style sheet theme, so to change the look just customize the CSS of the theme.

How do I change the amount of posts being displayed in the rankings?

The first parameter of the function to set the number of posts by default 5 posts will be listed, but if you want to change this value just set the value in the first parameter. For example, if you want the 10 most viewed posts are displayed use the following code to call the ranking:

<?php
if ( function_exists( 'displayRanking' ) ) {
displayRanking(10);
}
?>
How to display the thumbnail of the post?

To show the thumbnail you need to set the parameter to true $ thumb, below an example of displaying the ranking with thumbnail image:

<?php
if ( function_exists( 'displayRanking' ) ) {
displayRanking( '', '', '', '', true );
}
?>

評價

There are no reviews for this plugin.

貢獻者及開發者

“Post Ranking View” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Post Ranking View 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.1 2014-01-15

  • Including the option to show the post thumbnail

1.0 2014-01-04

  • Creation of the plugin, the initial version.