WordPress.org

Ready to get started?Download WordPress

Forums

Popularity Posts Widget
Filter category dynamically (13 posts)

  1. pauljavid
    Member
    Posted 1 year ago #

    Hello, I'd like to filter the popular posts displayed when the user clicks on a category. For example, suppose I click on a "Yoga" category, I'd like the popular posts widget to only display the most popular posts from the "Yoga" category. How can I do this? Happy to write some code if you give me some tips. I'm familiar with customizing wordpress. Doesn't look like the "filter" in the widget itself is dynamic.

    http://wordpress.org/extend/plugins/popularity-posts-widget/

  2. Mihail Barinov
    Member
    Plugin Author

    Posted 1 year ago #

    I make some changes for you: now in category page plugin will show only posts from the same cat.
    I hope this is what you want.

    I upgrade file class_popularity-posts-widget.php. Download new version of this file you can here: https://docs.google.com/file/d/0B-ZmXKKrCb4yYzkwTTRkeWtTc2M/edit

  3. pauljavid
    Member
    Posted 1 year ago #

    Thank you - I updated the staging environment for my blog at: http://meetcody.staging.wpengine.com/ with this new file, however, the popular posts widget still doesn't seem to be filtering by category when I choose one. Please try it out. Am I doing something wrong?

  4. pauljavid
    Member
    Posted 1 year ago #

    Sorry, I wasn't clear. It IS working perfectly (Thank you!!) for when a category is selected, but if no category is selected, I'd like it to show the most popular posts from across the blog. Right now, on the homepage it is empty: http://meetcody.staging.wpengine.com/

    But in a category it works great: http://meetcody.staging.wpengine.com/category/swimming/

  5. pauljavid
    Member
    Posted 1 year ago #

    Sorry, the plugin now seems pretty inconsistent. You can try filtering by categories, and you'll notice that popular posts from other categories also show up. Why is this?

    For example, I go to the "Crossfit" category, but posts from "Barre" show up as popular in the widget. Ideas?

  6. Mihail Barinov
    Member
    Plugin Author

    Posted 1 year ago #

    Ok, tonight I will watch what is wrong witch it.

  7. pauljavid
    Member
    Posted 1 year ago #

    I pushed it to our live blog: http://blog.codyapp.com/

    We get fair traffic to this blog, and you can see that the filter isn't working, and it looks like it's not updating dynamically based on clicks either.

  8. pauljavid
    Member
    Posted 1 year ago #

    Hello, were you able to find anything? I'd love to get this working on my blog.

  9. Mihail Barinov
    Member
    Plugin Author

    Posted 1 year ago #

    There is new version of plugin available now.
    I hope it will works fine for you.

  10. pauljavid
    Member
    Posted 1 year ago #

    I updated it and then immediately nothing showed up on my site...

  11. pauljavid
    Member
    Posted 1 year ago #

    meaning, there no longer were any popular posts. Perhaps this is because I updated my previous code with the extra code you gave me? Could you please give me a zip of the correct code that I can try?

  12. pauljavid
    Member
    Posted 12 months ago #

    Hello there, I'm having two issues:

    Please take a look at my blog here: blog.codyapp.com

    1) In the popular posts widget, if you inspect the element it is adding linebreaks. I'd like to remove them so that the picture and the text are right next to each other.

    2) I'd love if when the user when to a category, that the popular posts for just that category showed up. Same if they visit a post from that category.

  13. Primitive
    Member
    Posted 10 months ago #

    Paul, did you work this out in the end?

    1) Not ideal, but you could just display: none; the linebreak in your CSS

    2) You can do this with the widget logic plugin, by setting up a separate PPW widget for each category, and then making sure it is only shown on the siderbar of content in that category with widget logic along the lines of is_category(1) || (is_single() && in_category(1))

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic