WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-PostViews] ordering posts in category (1 post)

  1. newagespirit
    Member
    Posted 1 year ago #

    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
    Use:

    <?php if (function_exists('get_most_viewed_category')): ?>
        <ul>
            <?php get_most_viewed_category(); ?>
        </ul>
    <?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

Topic Closed

This topic has been closed to new replies.

About this Topic