Is there stat for each article views in homepage , category and single post ? [ DW Focus ]
I can’t find the counter of views for each article in DW Focus. Is there stat system in this or I have to use more plug-in
Hi !
Currently, theme Dw_focus not supported this function. you can search on
URL : http://wordpress.org/extend/plugins/
or you can used
– WP Postviews
– Google Analytics
Regards,
Dominic
Hi DesignWall Team,
Could you please tell what that function does in your function.php file:
/**
* Views count for a single post
*/
function dw_focus_post_views() {
if( is_single() ){
global $post;
$view = get_post_meta($post->ID, ‘_views’, true);
$view = $view ? $view+1 : 1;
update_post_meta($post->ID, ‘_views’, $view);
echo ‘‘;
echo ‘‘;
if( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb = wp_get_attachment_thumb_url( $thumb_id );
echo ‘‘;
echo ‘‘;
}
}
}
add_action(‘wp_head’, ‘dw_focus_post_views’);
}
Please login or Register to submit your answer