WordPress.org

Ready to get started?Download WordPress

Forums

Most Popular and Commented Posts Plug in (6 posts)

  1. emalen
    Member
    Posted 7 years ago #

    I'm looking for a way to add a 'most popular posts' and/or 'most commented on posts' category to my sidebar. I have searched the forum and can't seem to find this plugin

    any link in the right direction for this would be much appreciated.

    thanks

    theTVaddict
    http://www.thetvaddict.com

  2. Kafkaesqui

    Posted 7 years ago #

    Have you looked through the plugins here:

    http://codex.wordpress.org/Plugins/Statistics
    (Google cache for page if Codex is down)

  3. Alex King
    Member
    Posted 7 years ago #

    Try my Popularity Contest plugin:

    http://alexking.org/projects/wordpress

  4. emalen
    Member
    Posted 7 years ago #

    Dear AlexKing.

    Thanks for your hard work and recommendation

    My only question

    It's very easy to activate.

    My one question is that I'd like to remove the "Popularity: 12% [?]" from each post.

    I only want to have the "Comments" tag viewable on my site's sidebar.

    Is that possible?

    Thanks

    Daniel

    http://www.thetvaddict.com

  5. Alex King
    Member
    Posted 7 years ago #

    To remove the displayed information, read the README:

    http://svn.wp-plugins.org/popularity-contest/trunk/README.txt

    Showing the other lists in the sidebar can be done, but would require you to make a few modifications on your own.

  6. cjason
    Member
    Posted 7 years ago #

    I recently wrote a custom WordPress query to retrieve the most popular post (based on # of comments) on my site and give me access to the post title, excerpt, slug, date, and # of comments. The following code can go inside or outside The Loop. It will work both ways. You will also need to add the appropriate formatting for your site to make it look good, of course.


    <?php
    $hotTopic = $wpdb->get_row("SELECT count(comment_id) as comments, comment_post_id, wp_posts.post_title, wp_posts.post_excerpt, wp_posts.post_name, wp_posts.post_date FROM wp_comments LEFT JOIN wp_posts on comment_post_id=wp_posts.ID WHERE comment_approved != 'spam' GROUP BY comment_post_id ORDER by comments DESC LIMIT 1");
    if (isset($hotTopic) || $hotTopic) {
    echo $hotTopic->post_title; // Post Title
    echo $hotTopic->comments; // # Comments
    echo trim($hotTopic->post_excerpt); // Post Excerpt
    echo$hotTopic->post_name; // Post Slug
    echo date('l, F jS, Y',strtotime($hotTopic->post_date)); // Post Date w/ formatting
    }
    ?>

    - Chris
    http://www.christopherjason.com/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags