query post to diferents role users
-
Is it possible to show different posts to a diferent role users?? I need something like this
User A logged in => Post A ||
User B logged in => Post B
I can’t use UserID, because there will be a lot of users. I was thinking something like this
<?php if ( is_userA_logged_in() ) { echo 'Welcome A user!'; //here comes the query } elseif ( is_userB_logged_in() ) { echo 'Welcome B user!'; // here comes the query } ?>
I was reading on the codex but I only found the is_admin(), how can I call the new role i’ve created?
I’d create the new roles in the functions.php with
<?php add_role('userA', 'User A', array( 'read' => true, // True allows that capability 'edit_posts' => false, 'delete_posts' => false, // Use false to explicitly deny ));?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘query post to diferents role users’ is closed to new replies.