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

  1. farshadvl
    Posted 3 years ago #

    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. Adam
    Posted 3 years 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
    Posted 3 years 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


No tags yet.