• Resolved enforces

    (@enforces)


    I have a code in template core:

    static function bk_setPostViews($postID){
                $count_key = ‘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);
                }
                return false;   
            }

    But the +1 view after visit don’t work with LiteSpeed Cache. How to resolve it? Can I add any exclusion?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Post View count don’t work with litespeed cache’ is closed to new replies.