The plugin works fine however I'd like for it to also display the excerpt from the post in the sidebar as well...I don't want the entire post content to display, just the excerpt...can you please give me the code? Thank you
The plugin works fine however I'd like for it to also display the excerpt from the post in the sidebar as well...I don't want the entire post content to display, just the excerpt...can you please give me the code? Thank you
You want this plugin can count the post views times when you use the_excerpt(); function to display.
The most easy way is find
add_filter('the_content', 'process_postviews');
and add the code
add_filter('the_excerpt', 'process_postviews');
after what you find
I will do more test, and release a new version
What I really need to do is display the post content (ONLY before the <!--more--> tag). I am able to add the entire post content by using "post_content", however I just want to display the content before the <!--more-->...
I have to edit something here (line 151 in postviews.php):
if($chars > 0) {
foreach ($most_viewed as $post) {
$post_title = htmlspecialchars(stripslashes($post->post_title));
$post_views = intval($post->views);
$post_views = number_format($post_views);
$temp .= "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a></li>\n";
}
} else {
foreach ($most_viewed as $post) {
$post_title = htmlspecialchars(stripslashes($post->post_title));
$post_views = intval($post->views);
$post_views = number_format($post_views);
$temp .= "<li><a href=\"".get_permalink()."\">$post_title</a></li>\n";
}I cannot find add_filter('the_content', 'process_postviews');
Sorry To You!
I think you are using WP-PostViews From Lester 'GaMerZ' Chan.
It,s not the same.
This topic has been closed to new replies.