WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Is there a way to display views counted by WordPress Popular Posts in the post (3 posts)

  1. clouder
    Member
    Posted 7 months ago #

    I want to show the number of views of my posts in the posts themselves instead of just the sidebar.

    I'm thinking maybe I can modify single.php to modify the contents of a single posts to also query the views that have been registered in WordPress Popular Posts.

    http://wordpress.org/plugins/wordpress-popular-posts/

  2. dMpmJ
    Member
    Posted 7 months ago #

    You should try reading the plugin's page dude.

    http://wordpress.org/plugins/wordpress-popular-posts/installation/

    I think you'll most likely want to edit content.php and/or content-*.php and add <?php if (function_exists('wpp_get_views')) { echo wpp_get_views( get_the_ID() ); } ?> somewhere in there. Note that the ID is required. It also accepts a second parameter to indicate time period (e.g., 'weekly'); again, see the plugin's page for more information on how this function works.

  3. clouder
    Member
    Posted 7 months ago #

    Wow.

    That worked. You are the bomb :PPPPPPP

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.