remove views count _meta_fields.php
because its not working here
This commit is contained in:
parent
ff51b85152
commit
c041f39561
@ -4052,26 +4052,3 @@ add_action( 'save_post', 'fictioneer_save_recommendation_metaboxes' );
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Post Views
|
||||
*
|
||||
*/
|
||||
|
||||
function set_post_views($post_id) {
|
||||
$key = 'post_views';
|
||||
$count = get_post_meta($post_id, $key, true);
|
||||
$count = (empty($count)) ? 1 : $count + 1;
|
||||
update_post_meta($post_id, $key, $count);
|
||||
}
|
||||
|
||||
function track_post_views() {
|
||||
if (is_single() && get_post_type() == 'fcn_story') {
|
||||
set_post_views(get_the_ID());
|
||||
}
|
||||
}
|
||||
add_action('wp', 'track_post_views');
|
||||
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user