Count views for single posts and pages

This commit is contained in:
Brian Miyaji
2014-01-25 16:09:55 +11:00
parent 8db2a05fa3
commit 84233c4d8b
5 changed files with 51 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
<?php
function sportspress_the_content( $content ) {
sportspress_set_post_views( get_the_ID() );
if ( is_single() || is_page() )
sportspress_set_post_views( get_the_ID() );
return $content;
}
add_filter( 'the_content', 'sportspress_the_content' );