WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] How to exclude a post (23 posts)

  1. cyclopse
    Member
    Posted 1 year ago #

    hey buddy can u tell me how can i exclude a post which wont come in popular post.
    thanx in advance.

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

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    At the time the plugin doesn't offer any functionality to exclude posts, only categories. Might add this functionality on future releases.

  3. Nicolas
    Member
    Posted 1 year ago #

    Hi Hector,
    I have a question related to the same issue. I'd like to remove the current post from the list of popular post.
    To make it clear if 'post1' is the most popular post, it will show in first position in the sidebar, then I click on the link and visit the 'post1' page and I still have the same 'post1' in first position in the sidebar. So the most popular post of my blog is linking to itself.

    I manged to get only posts from the same category showing with the code below, but I can't figure out how to exclude the current post. Any idea? Thanks

    <?php
    $category = get_the_category($post->ID);
    $category  = $category[0];
    if (function_exists('wpp_get_mostpopular')) wpp_get_mostpopular("cat=".$category->cat_ID."&range=weekly&order_by=views&limit=4&excerpt_length=55&stats_comments=0"); ?>
  4. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    I have a question related to the same issue. I'd like to remove the current post from the list of popular post.
    To make it clear if 'post1' is the most popular post, it will show in first position in the sidebar, then I click on the link and visit the 'post1' page and I still have the same 'post1' in first position in the sidebar. So the most popular post of my blog is linking to itself.

    Someone else mentioned something similar some time ago. I believe that it'd be better to just remove the link from the post being viewed - that way, we can still show it on the list and avoid havint it linking to itself.

    What do you think?

  5. cyclopse
    Member
    Posted 1 year ago #

    hey hector so when i can expect this feature from u ????

  6. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    I might post a test version here so you guys can try it, probably this upcoming weekend.

  7. Nicolas
    Member
    Posted 1 year ago #

    Hi Hector,

    I think it would be better to remove the current post completely because the user is already reading the post. Plus, you may have duplicate content on the same page if you didn't write a unique excerpt. (wordpress will take the first X words/characters).

    I was thinking more about something similar to the 'exclude' parameters in get_posts. Maybe you can add a post_id parameter in your plugin. For example, you already have the author parameter, so I guess if I write: author="-4" it will exclude posts from this author.
    With the post_id parameter we will be able to exclude the current post using something similar to what I have done for category.

  8. cyclopse
    Member
    Posted 1 year ago #

    and one more thing y it wont pic the image if the image was not uploaded through the post is it possible that the plugin will pic the first image associated with the post.

  9. Nicolas
    Member
    Posted 1 year ago #

    Hi Hector,

    Did you have time to look at it by any chance?
    Have a great weekend!

  10. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Nicolas,

    I will be posting a test version in a few hours, stay tuned!

  11. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Alright people, just uploaded a new development version of the WPP plugin now. It contains the new Post Exclusion feature (among other things), so please test it and post your feedbacks here.

    @Nicolas: the feature to remove a post from the list when viewed on single.php is still pending. Will let you know when it's done.

  12. cyclopse
    Member
    Posted 1 year ago #


  13. cyclopse
    Member
    Posted 1 year ago #

    ok found it but it will be better if u provide exclude post check box on the post page so the post needed to be excluded just need to click on that check box and its done but still thanx for ur efforts buddy its just a suggestion....

  14. cyclopse
    Member
    Posted 1 year ago #

    one more prob after putting the excluded post code and u click on save button it wont being shown in the exclude post text box and as u kept 10 post for popular post and when u exclude a post there only 8 left and wen u keep 12 post then it left 10 post. so plzz fix this problem...

  15. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    ok found it but it will be better if u provide exclude post check box on the post page so the post needed to be excluded just need to click on that check box and its done but still thanx for ur efforts buddy its just a suggestion....

    I like it better as it is now since that's also how the category exclusion works. And you woulnd't need to go to the Posts page only to exclude one or two entries, you can do it all from the widget interface. Seems more user-friendly to me, don't you think?

    U kept 10 post for popular post and when u exclude a post there only 8

    Oh, good point. I'll check that in a couple of hours.

    Thank you for your feedback!

  16. cyclopse
    Member
    Posted 1 year ago #

    its taking daily views instead of the choice i m making ....

  17. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    You need to be a little bit more specific than that in order to get some help from me. What is taking daily views instead of what value? Are you using the widget, the shortcode or the template tag, or the problem is happening on the Stats panel? What are the settings?

  18. Nicolas
    Member
    Posted 1 year ago #

    @Hector,
    Thanks for the update.
    To exclude the current post I only had to enter this parameter &pid=".$post->ID."

  19. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, that's a clever idea! Thanks for sharing it, will suggest that to anyone running into a similar situation in the future.

  20. Nicolas
    Member
    Posted 1 year ago #

    Put it inside your FAQ it may avoid repeated questions!

  21. vicman
    Member
    Posted 1 year ago #

    Hi! Can anyone please let me know where to put that code?

    &pid=".$post->ID."

    I use the shortcode for this plugin so i am not sure where or how to put this.

    Thanks!

  22. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi vicman,

    The pid is a new parameter introduced in the development version of the plugin (linked earlier in the thread) and it's not supported on the current stable version of WPP (v2.3.2 at the time of writing this). To use it, you'd need to download and install the development version and then do something like:

    [wpp pid=XX]

    ... where XX is the post ID you wish to ecclude from the listing.

  23. GiaP
    Member
    Posted 9 months ago #

    Help, the plugin is including my backend login page in the popular posts list in my sidebar!!!

    I can't seem to find the page id for the WP login screen. Any clue what it should be or where/how to find this info? Thanks in advance! Great plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic