Changeset 979828
- Timestamp:
- 09/04/2014 04:47:18 PM (12 years ago)
- File:
-
- 1 edited
-
wp-author-ranking/trunk/Readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-author-ranking/trunk/Readme.txt
r979815 r979828 19 19 3. Open the setting menu, it is possible to set the execution condition. 20 20 21 === Get the ranking data. === 22 23 The function "get_wpAuthorRanking()" return the ranking data stored in an array. 24 This example prints ranking data. 25 26 ``` 27 <?php 28 $rankingData = get_wpAuthorRanking(); 29 for ($i=0; $i < count($rankingData); $i++) { 30 echo '<li>'; 31 echo '<p>No'.$rankingData[$i]['rank'].'</p>'; 32 echo '<p><strong>'.$rankingData[$i]['display_name'].'</strong></p>'; 33 echo '<p>'.$rankingData[$i]['count'].'pv<p>'; 34 echo '</li>'; 35 } 36 ?> 37 ``` 38 39 === Informations the ranking data has. === 40 41 * ID 42 * user_login 43 * user_nicename 44 * user_email 45 * user_url 46 * user_registered 47 * user_activation_key 48 * display_name 49 * count (page view count) 50 * rank (rank) 51 52 53 ==== Request options ==== 54 55 You have four options to require ranking data. 56 57 * y (year) 58 * m (month) 59 * d (day) 60 * cpt (custom post type) 61 62 This example gets columnist (post type 'column') ranking in September 2014. 63 64 ``` 65 <?php 66 $rankingData = get_wpAuthorRanking(array('y'=>2014, 'm'=>9, 'cpt'=>'column')); 67 for ($i=0; $i < count($rankingData); $i++) { 68 echo '<li>'; 69 echo '<p>No'.$rankingData[$i]['rank'].'</p>'; 70 echo '<p><strong>'.$rankingData[$i]['display_name'].'</strong></p>'; 71 echo '<p>'.$rankingData[$i]['count'].'pv<p>'; 72 echo '</li>'; 73 } 74 ?> 75 ``` 76 77 78 === Count pv manually === 79 80 In default setting, page views are counted at single post page. You also have the function "count_wpAuthorRanking()" to count authors page views manually. 81 This example counts id-3 user on 'column' post type. 82 83 ``` 84 <?php 85 count_wpAuthorRanking(array('user'=>3,'cpt'=>'column')); 86 ?> 87 ``` 88 89 21 90 == Screenshots == 22 91
Note: See TracChangeset
for help on using the changeset viewer.