• Resolved marbab

    (@marbab)


    Hi,

    I am using WP, popular post plugin. And it is working fine. I am just wondering, if I can use the same data to show views of each post on the post in footer?

    So e.g If I have 10 post, and popular post is showing top 3 post for me.

    However, for each of 10 posts, I want to show “views” count of each post. How is it possible?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @marbab,

    I’m not quite sure I understand what you’re trying to do. Could you please elaborate a bit more?

    Thread Starter marbab

    (@marbab)

    I thank you for looking into this Héctor.

    Let me explain feature I am looking for.

    1) I am using Popular post plugin. Using this plugin, I can show the “most” popular post in by widget (sidebar).

    2) Sidebar widget shows post title, Link and number of views. (Top 5 posts).

    What I understand is that this plugin stores views of each post in WordPress table to calculate the top 5 (or defined number) of posts.

    I want to show number of times a post has been viewed, as footer of each post. Is it possible to get the number of views of a post (using a function) and show at the bottom of each post.

    So basically, is there a function that can query popularpostsdata table given a postid, and return me pageViews? I can use that function as footer of each post as :

    Total views of current page : <1010101>

    Plugin Author Hector Cabrera

    (@hcabrera)

    No problem, @marbab. Actually I was pretty sure that was what you were asking but had to be sure 😛 Thanks for clarifying.

    And to answer your question yes, there’s a function for that: wpp_get_views().

    Thread Starter marbab

    (@marbab)

    Perfect. thanks 🙂 I will straight away add to my footer.php

    Thread Starter marbab

    (@marbab)

    Marking as resolved

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Reuse popular post data per post for individual post’ is closed to new replies.