How to filter discourse_topics shortcode output by category?

I am using the Discourse shortcode plugin to show topics in WordPress.

The shortcode attributes do not have an option to filter the output based on categories. There are some categories such as site feedback and introduce yourself that are visible to everyone on Discourse instance but I don’t want posts from these to be visible on a feed in WordPress.

Is there a way to make this happen?

4 Likes

Hey @Himanshu_Singh,

The wp-discourse-shortcode plugin is currently maintained by Communiteq (@RGJ).

I’ve made a PR that adds the ability to restrict posts to a specific category. I know that isn’t exactly what you’re after, however unfortunately discourse doesn’t support filtering a single topic list by multiple (but not all) categories (i.e. you can’t do that on Discourse itself).

3 Likes

Thank you, Angus. It’s definitely a good start and I wonder why Discourse does not allow multiple category filtering. The more complex a community becomes catering to different user needs, more customized the experience needs to be for each user type.

I have merged your pull request, thanks @angus !

3 Likes