Site logo

Archived topic

how to dynamic Category group at post edit by role with code

5 replies · Started by martin_ym on October 27, 2022

Viewing posts 1–6 of 6

------ question
how to dynamic Category group at post edit by role with code?
I searched here and could not find nearby solution

------ refer to
https://docs.generatepress.com/article/exclude-categories-from-posts-page/

------ Category
--- assume cat id = number, E.g. cat 12 id=12
--- cat
cat 1
-cat 11
-cat 12
cat 2
-cat 21
-cat 22
--cat 221
--cat 222
-cat 23
cat 3
...
------ user role
role1 permit Category group: cat 1, cat 3

role2 permit Category group: cat 2, and exclude cat 23

group parent auto include children, unless exclude

Hi Martin,

To clarify, are you wanting to exclude certain posts of specific categories from appearing in your Blog Page based on roles?

Yes, when the user add/edit posts while corresponding specific categories by user role, hide exclude categories ids
It is maybe out of GP support, I am appreciated if get any help.

Oh. You'll need custom code for that.

It would be best to reach out to WordPress itself with regards to this as this would be out of our scope and expertise.

Here's a link you may go to: https://wordpress.org/support/forum/wp-advanced/

You're welcome Martin thanks for sharing!

This archived topic is closed to new replies.