Support » Plugin: Popularity Posts Widget » Filter category dynamically

  • pauljavid

    (@pauljavid)


    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/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    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

    Thread Starter pauljavid

    (@pauljavid)

    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?

    Thread Starter pauljavid

    (@pauljavid)

    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/

    Thread Starter pauljavid

    (@pauljavid)

    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?

    Plugin Author ILLID

    (@mihail-barinov)

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

    Thread Starter pauljavid

    (@pauljavid)

    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.

    Thread Starter pauljavid

    (@pauljavid)

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

    Plugin Author ILLID

    (@mihail-barinov)

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

    Thread Starter pauljavid

    (@pauljavid)

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

    Thread Starter pauljavid

    (@pauljavid)

    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?

    Thread Starter pauljavid

    (@pauljavid)

    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.

    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))

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Filter category dynamically’ is closed to new replies.