WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
wordpress popular posts plugin stop loop and display 1 item (3 posts)

  1. dude110
    Member
    Posted 1 year ago #

    Hi there,
    I wanted more control over the way the widget looks in the "wordpress popular posts plugin" so I enabled PHP to work within Widgets and I tried to call the plugins functions from there so I can have more control over what shows.

    I used extra attributes and everything work fine, the code I wrote within the widget is:

    <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("range=weekly&stats_comments=0&stats_views=1&order_by=views&limit=5"); ?>

    The problem is that since the loop is happening internally inside the plugin, the above code doesn't allow me to add extra displays with each post title.

    For example I want to be able to added a little star rating beside each title but since the above code delivers one whole loop package I cant modify individual outputs.

    All I'm trying to do is have 5 most popular posts listed by page views not comment count, and at the same time be able to add anything extra I want beside each title.

    So my question is, is it possible to stop the loop inside the plugin so I can output each post individually and I can then place it inside word press loop, OR is there a way to add the extra displays I need to show up with each post from within the plugin?

    Thanks a lot for your help, first time posting, let me know if you need more information.

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    The plugin already supports a star rating system, WP-PostsRating. If installed and enabled, WordPress Popular Posts will retrieve the data from WP-Posts-Rating and display the star rating of each post listed.

    There's also another non-documented feature of WordPress Popular Posts: passing true as second parameter to the function will return the data instead of echoing it. That way, you can manipulate the list before printing it. It's been ages since I last updated that part of the code though, so it probably needs improvements.

  3. dude110
    Member
    Posted 1 year ago #

    Thanks for your reply Héctor, I appreciate it.

    Take Care. :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic