Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End View Count from PHP function works, but sometimes it appears blank, How can I fix this?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45499
    asiek
    Participant

    Every once in awhile I visit my blog page and the View Count for videos are blank…
    I then refresh the page multiple times and all of the sudden View Count will appear again.
    I don’t understand what is happening…

    #138541
    asiek
    Participant

    @AlenAbdula No the issue wasn’t resolved :/

    #138527
    asiek
    Participant

    I used this PHP Function//

    
    $video_ID = get_post_meta($post->ID, 'v_id', true);
    $JSON = file_get_contents("https://gdata.youtube.com/feeds/api/videos/{$video_ID}?v=2&alt=json");
    $JSON_Data = json_decode($JSON);
    $views = $JSON_Data->{'entry'}->{'yt$statistics'}->{'viewCount'};
    echo $views; ?>

    Could it have something to do with Youtube rather than the function I used or what? Any ideas/solutions?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.