Support » Plugin: WordPress Popular Posts » [Plugin: WordPress Popular Posts] Increase post view count within code

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi ozkan,

    Sorry, I’m not following here. What do you mean by “increment post’s view count by code”?

    When a post detail page is opened by user, WordPress Popular Posts plugin adds +1 to the click count of that post. What I want is to make it in a php file by writing a code like incrementPostCount(post_id); Is there a way to do it, or where should i check for that in the plugin’s codes. Any help is appreciated.

    Thanks for your response.

    I see, but why do you want to do that exactly?

    Because when a post link is clicked i want to make a redirection to another page or post, but still want that post to get its click count. So then i think the way to do it is to increment it by code, if i am not wrong.

    Don’t think you need to to that if you’re using my plugin. Once the user lands on a page or post my plugin should detect it and increment the view count automatically (that is, assumming that you’re redirecting them to another page or post inside your blog).

    I was expecting that too, but it didn’t work like that. I put my redirection code at the end of index.php, but plugin never incremented it.
    I use this code for redirection:
    header (“Location: $URL”);

    Mmm that’s odd. Can you please check if there’s a WPP javascript code on your posts’ <head> section after the redirection is done?

    No, I want to wpp_update the page that I redirected from. I mean if i click on post1 then i redirected to post2, i want post1 to get +1 pageview.
    So i guess it is not happening because the WPP javascript not even loaded and run because before it’s posted to the client i make a redirect. So I think it is possible only by code. I know what I need is a little awkward, but do you have any suggestion?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Increase post view count within code’ is closed to new replies.