WordPress.org

Ready to get started?Download WordPress

Forums

how to display post content for special Role? (3 posts)

  1. farshadvl
    Member
    Posted 1 year ago #

    hi
    i have a wordpress website with 1000 post.
    my site have a lot of categories and two kind of rols :freeuser and vip user.
    both of them see all post but in single freeuser don't see content of special categories but vip can.

  2. Umbercode
    Member
    Posted 1 year ago #

    Assuming that you added roles using add_role you can then assign capabilities to these roles using add_cap
    Next it is just a simple conditional to test for these capabilities in your loop using current_user_can

  3. farshadvl
    Member
    Posted 1 year ago #

    thanks Umbercode
    but there is a problem here.freeuser should see content of cat a,b,c
    but with this role and cap they can't see the content.

    is there any plugin or code to restrict content?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.