WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Janu Studio
    Member
    Posted 1 year 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/

    http://wordpress.org/extend/plugins/baw-post-views-count/

  2. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Hello

    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

About this Topic

Tags

No tags yet.