Post Views Count (Support caching plugins!)
HELP! How to show total views including attachments of a post? (2 posts)

  1. janustudios
    Posted 3 years ago #

    Hi there, i want to use this plugin on my website, Its very popular and big name CGRamp.com, can you let me know how can i include post views from Attachment and show as total on single post page like for an example my attachment views for a single post in 3000 counts where the post views are 1000 so if we combine that would be 4000 views right? can anyone help me out...

    Post Page: http://www.cgramp.com/making-of/disneys-paperman-short-cg-animated-vfx-technology-breakdown

    Attachment page : http://www.cgramp.com/making-of/disneys-paperman-short-cg-animated-vfx-technology-breakdown/attachment/disneys-2dcgi-animated-short-paperman-2/


  2. Julio Potier
    Plugin Author

    Posted 3 years ago #


    You can do this with my plugin, using the "baw_count_views_count" hook.
    You have to grab the attachment ID (5th parameter of the hook) from your viewed posts, get its counter with a simple get_post_meta( $attach_id, '_count-views_all', true ); ("all" if you need all views of course) then add it to the actual count (1st parameter of the hook) then return it.

    Do you understand ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post Views Count (Support caching plugins!)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.