WordPress.org

Plugin Directory

wiki:wp-postviews/install

WP-PostViews Installation Instructions

Open wp-content/plugins folder

Put:

  1. postviews.php


Activate WP-PostViews plugin



Open wp-content/themes/<YOUR THEME NAME>/index.php

Find:

<?php while (have_posts()) : the_post(); ?>

Add Anywhere Below It:

<?php if(function_exists('the_views')) { the_views(); } ?>

Note:

  • The first value you pass in is the text for views.
  • Default: the_views('Views');


Post Views Stats (You can place it anywhere outside the WP Loop)

To Get Most Viewed Post

Use:

<?php if (function_exists('get_most_viewed')): ?>
        <?php get_most_viewed(); ?>
<?php endif; ?>

Note:

  • The first value you pass in is what you want to get, 'post', 'page' or 'both'.
  • The second value you pass in is the number of post you want to get.
  • Default: get_most_viewed('both', 10);




Back To WP-PostViews Documentation

Last modified 12 years ago Last modified on 02/27/06 14:27:30