WordPress.org

Ready to get started?Download WordPress

Forums

Add code to Custom Field to see YouTube's actual views? (5 posts)

  1. livingsub
    Member
    Posted 1 year ago #

    Hi,

    I need that my YouTube videos displayed on my WordPress blog show the real YouTube views, instead of the views they are getting from the blog.

    When I edit each video I see that the custom fields include a "views" field, but it´s referred to the views from the blog itself. The custom fields can be accessed by clicking on the screen options tab at the very top of the edit page, by the way.

    So, is there a way to change the "value" field with some code which will display that video's YouTube views? Is there any other way to do that and get to see the real YouTube views for each video?

    Thanks!

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    As far as I know you'd have to use the youtube api. If you're comfortable programming, here's an example: http://stackoverflow.com/questions/3331176/how-to-get-number-of-video-views-with-youtube-api

  3. livingsub
    Member
    Posted 1 year ago #

    Hi there... What if I'm a normal user and have zero programming knowledge?

    Thanks!

  4. Andrew Bartel
    Member
    Posted 1 year ago #

    I would check out the amazing free plugins the WordPress community has generated. I did a quick google search and this one looked promising: http://wordpress.org/extend/plugins/embedplus-for-wordpress/

    That said, if you're really unable to find something in the WordPress repo, I'd be happy to throw together a plugin that lets you put in a shortcode to get the number of the views. But as I've often found writing code for a living, I'm rarely the first one with a specific problem and someone else has already put together a solution and is happy to share it with the world.

  5. livingsub
    Member
    Posted 1 year ago #

    Thanks, Andrew! I'll try that plugin.

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic