WordPress.org

Ready to get started?Download WordPress

Forums

Subscribers and categories (4 posts)

  1. Luigino
    Member
    Posted 3 years ago #

    Hello everyone,

    I set a blog with math games where I installed a Register Plus plugin so I can have a custom field that would allow on registration to choose which school grade of the registering user. For example in this case I have elementary and middle (junior high) school.
    And these choices (elementary and middle school) are created in wp_usermeta with a record like:

    umeta_id user_id meta_key meta_value
    380 21 school Junior High

    I have also some categories for elementary and some for middle school where I insert some math problems posts.

    So, my question: is there a way that I can connect categories to the meta_value so when a user joins will see only related posts so I can have an association?...
    Or the only way is to play with a custom loop with a custom SELECT in the index.php file?...
    Plus, as admin, I'd want to assign to users some points based on problem type... and I was thinking to create a custom table with fields like:

    user_id post_id points

    but first I'd ask if is there a way to insert that to wp tables using wp functions so I can easily query them using wp functions?...

    thanks to all in advance for the hints! :-)
    Ciao,
    Luigi

  2. Gisha James
    Member
    Posted 3 years ago #

    I think Role manager plugin has options to create new roles for users. It can be used to assign some categories to certain roles.

    as admin, I'd want to assign to users some points based on problem type... and I was thinking to create a custom table

    Helpful: http://codex.wordpress.org/Creating_Tables_with_Plugins

  3. Luigino
    Member
    Posted 3 years ago #

    HI Gisha and everyone,

    in fact, following your suggest about a Role manager I installed Capability Manager and Role Scoper plugins, then I created two new roles, elementary and middle, which I assigned those categories for elementary school to elementary role and same thing for middle school to middle role.
    Then I assigned to a new user the role middle school while I have some posts for elementary school then I checked in Users profile page to see if that new user has only those categories assigned.
    So I logged as new user but I see in the frontend also elementary school posts...wonder why or what is not working... maybe I have to modify something in the default loop code in index.php page?...

    Thanks in advance to all!
    Ciao,
    Luigi

  4. Luigino
    Member
    Posted 3 years ago #

    I investigated a bit and I found after assigning a custom role to user, ad then going inside user's profile as admin I see something like this:

    Role possibilities
    Wordpress Role assigned: MiddleSchool
    (contains Guest, ElementarySchool, Subscriber)

    so if I log in as that user I still see elementary's school posts...how I can REMOVE those Guest and ElementarySchool roles from that user?
    Thanks in advance to all

    Ciao,
    Luigi

Topic Closed

This topic has been closed to new replies.

About this Topic