WordPress.org

Ready to get started?Download WordPress

Forums

List popular posts (from WordPress.com Stats plugin) with WP_Query (5 posts)

  1. salromano
    Member
    Posted 3 years ago #

    I don't think this would be that hard to accomplish. Though, I'm not necessarily a coder, so I may be wrong. Regardless, here's the request.

    We've got the WordPress.com Stats plugin on our blog to track our visits and post popularity. In conjunction with that, we've got WordPress.com Popular Posts to list the most popular posts WordPress.com Stats are tracking on our front page's right sidebar.

    WordrPress.com Popular Posts' customization possibilities are severely limited, however. I'd like to customize it to match our 'Latest News' bit that shows up on the sidebar whenever you're on an article (example here). We use WP_Query to accomplish that style of listing.

    Is there, perhaps, anybody willing to try this? The code could look something like this (note the "popular=true").

    <?php
     global $post;
     $myposts = get_posts('numberposts=10&popular=true');
     foreach($myposts as $post) :
       setup_postdata($post);
     ?>
  2. salromano
    Member
    Posted 3 years ago #

    May I ask why this was moved to 'How-To and Troubleshooting'?

  3. salromano
    Member
    Posted 3 years ago #

    Bump.

  4. salromano
    Member
    Posted 3 years ago #

    Bump again. I still believe this is in the wrong forum. Why was it moved?

  5. keesiemeijer
    moderator
    Posted 3 years ago #

    what code do you use to show the 'Latest News'?

Topic Closed

This topic has been closed to new replies.

About this Topic