WordPress.org

Ready to get started?Download WordPress

Forums

Top 10 - Popular posts plugin for WordPress
[resolved] [How to] display views number on theme (17 posts)

  1. astrixoblix
    Member
    Posted 9 months ago #

    hello everyone,

    I want to display the view counters (%totalcount%, %dailycount% or %overallcount%) on my posts but with PHP function.

    I know it's possible by default in plugin settings, but actually i want to display the counters with PHP on my header posts on first page.

    could you give me some assist, please ?
    thanks

    http://wordpress.org/plugins/top-10/

  2. Ajay
    Member
    Plugin Author

    Posted 9 months ago #

    <?php if(function_exists('echo_tptn_post_count')) echo_tptn_post_count(); ?>
  3. astrixoblix
    Member
    Posted 9 months ago #

    thanks Ajay for responding.

    i have another question:
    how it's possible to display the counters separate. means i don't want to echo the whole content. for example i want to display only the overall counter without any other content, just the counter.

    thanks

  4. Ajay
    Member
    Plugin Author

    Posted 9 months ago #

    There is no way to do that currently. The plugin uses the settings in the settings page to display the count and text. So you're limited to only one style option.

    I'll put this on the TODO list for this plugin.

  5. astrixoblix
    Member
    Posted 9 months ago #

    Thanks Ajay for giving help.

    I will wait for new updates. it will be very nice if the plugin let us use the counters separately and manually, because they're not spam like other view counter plugins.

    thanks again

  6. Ajay
    Member
    Plugin Author

    Posted 9 months ago #

    Definitely :)

  7. Ajay
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    I've added a new function in the latest version of the plugin (1.9.8.5).

    You can use get_tptn_post_count_only($id, $count = 'total')
    Use either total, daily or overall to get the count.

  8. astrixoblix
    Member
    Posted 8 months ago #

    Hi,

    Thanks for you supports. keep it up!
    i will look forward back if anything missed or i had any other idea.

    thanks again.

  9. Ajay
    Member
    Plugin Author

    Posted 8 months ago #

    That sounds great. Do consider giving this plugin a good review :)

  10. aurezio
    Member
    Posted 7 months ago #

    Hello, great plugin man!

    May I ask you a question about the issue of this post?

    I added that php code to the page but on the page I see (overall count 1, today 1) on every post that hasn't been read yet... Is there a way to set a default phrase for that kind of posts?

    Thanks!

  11. Ajay
    Member
    Plugin Author

    Posted 7 months ago #

    There isn't a default phrase option.

    If there are no views or 1 view the plugin displays this as 1. The logic is that if a visitor has visited the page, then it is definitely 1 view.

  12. aurezio
    Member
    Posted 7 months ago #

    Yeah,you're right but I have a homepage that displays the excerpts of the 8 recent posts... maybe you can take a look at it here

  13. Ajay
    Member
    Plugin Author

    Posted 7 months ago #

    Is it the "(Letto 1 volte di cui 1 oggi)" part?

  14. aurezio
    Member
    Posted 7 months ago #

    Yes it is, sorry, I forgot to mention that the site is in italian :)

    It means (Read 1 time, 1 time today)

  15. Ajay
    Member
    Plugin Author

    Posted 7 months ago #

    There isn't a way to change this now. I'll put this on the list of things to do where you can set an alternate text in case there are no hits.

  16. aurezio
    Member
    Posted 7 months ago #

    That sounds great, thanks!

  17. Ajay
    Member
    Plugin Author

    Posted 4 months ago #

    Aurezio, you now have a new option in v1.9.9 on what to display when there are no visits on posts.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.