Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpb_set_post_views($postID) {
- $count_key = 'wpb_post_views_count';
- $count = get_post_meta($postID, $count_key, true);
- if($count==''){
- $count = 0;
- delete_post_meta($postID, $count_key);
- add_post_meta($postID, $count_key, '0');
- }else{
- $count++;
- update_post_meta($postID, $count_key, $count);
- }
- }
- //To keep the count accurate, lets get rid of prefetching
- remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
- week_count: integer
- current_week: datetime
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement