WordPress plug-in traffic to the article: CountPosts
CountPosts: blog can know the total number of visits and each article of visits
Can also be downloaded directly
How to use:
1. Single article of visits <? Php HitThisPost ( 'Hits :','');?> Added to single.php and index.php document position can express their personal preferences
2. The total number of visits <? Php mainCounter ( 'Visits :','');?> General put sidebar.php
'Total traffic' can be modified according to personal preference
3. Visits up to the article <? Php TopHitsList ();?> General put sidebar.php
The default is five, in order to appear as 10 to amend the document CountPosts.php TopHitsList function
$ top = 5 into $ top = 10
Description of the problem:
This plug-in the opening of the time in wp-posts in the table to establish a new field post_hits, so this will be prompted to the following error message:
WordPress database error: [Unknown column 'post_hits' in' field list ']
SELECT post_hits FROM wp_posts
This can not depend on tips, the key is the plug-in the ranks of the show click function in a small problem is that it will wp-posts in the table all the records show, and even including the annex to the draft and, so here need to be amended This function, please make the following changes.
TopHitsList find the definition of function, function in the body found in the code below:
$ SQL = "SELECT ID, post_title, post_hits, guid FROM". $ Table_prefix.
"posts ORDER BY post_hits DESC LIMIT 0,". $ top;
The above code will be amended to read as follows:
$ SQL = "SELECT ID, post_title, post_hits, guid FROM". $ Table_prefix.
"posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_hits DESC LIMIT 0,". $ top;
Powered provides the download to solve this problem.
| -- Welcome to this paper rating |
Related Log | In this paper, readers also concerned about the following:
|




































Leave a reply