Site logo

Archived topic

How to duplicate popular posts widget?

3 replies · Started by Former User on March 13, 2023

Viewing posts 1–4 of 4

Hello,

I am opening this topic for a continuation from my previous topic "https://generatepress.com/forums/topic/how-to-create-a-popular-posts-widget/"

So, basically I would like to add same functionality that we created for "Most Read" widget to "Popular Reviews" so it only counts reviews and for "Useful Guides" where it would only count guides.

How I can do this? Can I use same code and just filter query so it only shows results from a certain category or tag?

Thanks for your time,

Sara

Hi there,

Can I use same code and just filter query so it only shows results from a certain category or tag?

Yes. That code merges the custom_args with your query loop.
So in the query loop you can add a parameter for the taxonomy.

Should work :)

Hello David,

Sorry for the late reply, just wanted to let you know that worked perfectly :)

Thank you very much!

Sara

Glad to hear that

This archived topic is closed to new replies.