Viewing 4 replies - 1 through 4 (of 4 total)
  • Richer Yang

    (@fantasyworld)

    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

    Thread Starter johnep

    (@johnep)

    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";
    
    				}

    Thread Starter johnep

    (@johnep)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Include Post Excerpt ?’ is closed to new replies.