| 开发者 | leobaiano |
|---|---|
| 更新时间 | 2014年1月16日 01:59 |
| 捐献地址: | 去捐款 |
| PHP版本: | 3.8 及以上 |
| WordPress版本: | 3.8 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/wp-content/plugins/ directory;Plugins menu in WordPress;<?php if ( function_exists( 'displayRanking' ) ) { displayRanking(); } ?>
2 - Save an array with the data in a variable
<?php if (function_exists ('displayRanking')) { $posts = displayRanking( '','','', true ); ?>
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
?>`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.
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); } ?>
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 ); } ?>