how to get number of views that your plugin use

HomeSupportPopular Widgethow to get number of views that your plugin use

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #354133

    amenzoweb
    Participant

    Hello im using your nice plugin popular widget and i need a function to get number of views that you use , to display that under each post ( not in widget but in post ( bottom of post) is there a way please ?

    second question : can i display number of views near recent posts too?

    Thank you and great job

    #355185

    Xpark Media
    Keymaster

    @amenzoweb,

    Yes, you should be able to display the views under each post by using get_post_meta() function. bellow is an example.

    echo get_post_meta($post_id, '_popular_views', true );

    $post_id is the id of your post “_popular_views” is the custom post value added to each post, that is if you did not changed this setting. Otherwise see “Custom Field” field in the widget.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.