• Resolved asfarfordev

    (@asfarfordev)


    Thanks for developing this addon

    I’m looking for a way to get total views for all articles of a certain category, and I used this code:
    wpp_get_views($category->term_id);

    But it gives a value of 0 ,even though the articles in the category recorded visits

    The page I need help with: [log in to see the link]

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

    (@hcabrera)

    Hi @asfarfordev,

    It seems that there’s a bit of a confusion here.

    WordPress Popular Posts doesn’t keep track of category (nor any other taxonomy) page views. The plugin tracks visits to posts, pages, and custom post types only. It doesn’t keep track of visits to archive pages, like categories.

    Also, the documentation of the wpp_get_views() function clearly states that the first parameter should be either a post ID, a page ID, or a custom post type ID.

    The description of the function on the Wiki even says this:

    The wpp_get_views() template tag returns the views count of a single post/page/custom-post-type.

    Not sure why anyone would think that the function returns views count for categories as well.

Viewing 1 replies (of 1 total)
  • The topic ‘wpp_get_views($category->term_id); get 0 view’ is closed to new replies.