WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Suggestion: Don't display current post? (7 posts)

  1. Newfound
    Member
    Posted 1 year ago #

    Hi Hector!

    From the point of view of someone always wanting my users to click on a new post and be given new options, I was wondering if there was a way that the post that the current user is viewing will not show (be excluded) on the list of top posts. I've seen another completely different plugin do this (Featured Content Plugin maybe?), but just wanted to suggest this feature or inquire about how the code could be adjust to accomplish this.

    Still, amazing plugin!

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

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    Thank you for your suggestion. Actually, I've implemented post exclusion in the development version of the plugin and someone used that to do just what you described. It only works with the [wpp] shortcode and the wpp_get_mostpopular() template tag for now, though.

    Also, keep in mind that the development version is for testers only, not meant for use in live sites yet (although I believe it's quite stable, should be safe to use).

  3. Newfound
    Member
    Posted 1 year ago #

    Great! Any idea when the new version will be officially released? Also, if I only wanted to show the plugin on my homepage would the template tag read:

    <?php if (is_home()) { wpp_get_mostpopular() } ?>

    I can put this in a new thread, if that's better!

  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Well, I'm pretty sure it's ready for release as it is now. However, I want to test it for a few more days to be 110% sure everything's fine. I'd love it if you can help testing it too, if that's OK with you of course.

    About your code, yes that should be OK.

  5. Newfound
    Member
    Posted 1 year ago #

    Great, thanks! Just installed the plugin and waiting for it to gather data to see any output. Seem to have installed just though.

    The code didn't work, btw, but figured it out if others are having trouble:

    ` <!-- Popular Posts Widget -->
    <?php if (is_home()): ?>
    <?php if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular(); ?>
    <?php endif; ?>`

    Now will only show on home page :D

  6. Newfound
    Member
    Posted 1 year ago #

    One more question, Hector: Do I have to implement some setting to get the current post not show? Or is this now an auto function?

    If it's an auto function, one thing that comes to mind is that then the "limit=x" might get messed up. For style reasons, I'll want always three popular posts displayed. The current post may or may not be one of the popular posts, yet I always want three to always show.

    Does this make any sense? I imagine you've already covered this base, just a thought I had.

  7. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Yep, you need to do this and it'll work. It's not automatic yet, that will come on a future release.

    About the limit parameter, it tells WPP to list up to X posts. What would happen, for example, if someone has a new blog and has less than X posts? Or, what if I want to list X posts from Category Y and that category has only X-1 posts? :P

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.