Support » Plugins » [Plugin: WP-PostViews] ordering posts in category

  • I am tryiing to make category pages list posts in order of popularity rather than default reverse date order. I think this may be possible with WP-PostViews but as a relative WP newbie am struggling with the sparse documentation, which says:

    To Display Most Viewed Posts For A Category

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

    The first value you pass in is the category id.
    The second value you pass in is what you want to get, ‘post’, ‘page’ or ‘both’.
    The third value you pass in is the maximum number of post you want to get.
    Default: get_most_viewed_category(1, ‘both’, 10);

    Could someone please tell me what file and where within the file I need to add this PHP and confirm whether if I do so it will produce the desired result, eg if someone clicks on category XYZ they will see a list of posts in this category in order of page views.

    If this is not what WP-PostViews does then I’d very much appreciate if someone could point me towards an alternate means of achieving this.

    Thanks in advance

  • The topic ‘[Plugin: WP-PostViews] ordering posts in category’ is closed to new replies.