2011-11-17 48 views
1

是否可以向不同角色显示不同帖子用户?我需要像这样的东西向WordPress中不同角色用户查询帖子

用户A =>发布A ||

用户B =>邮政乙

我不能使用用户名,因为会有大量的用户。我想这样的事情

<?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 
} 
?> 

我正在读的抄本,但我只找到了is_admin(),我怎么能叫一个新的角色?

我想创建在functions.php的新角色与

<?php 
add_role('userA', 'User A', array(
    'read' => true, // True allows that capability 
    'edit_posts' => false, 
    'delete_posts' => false, // Use false to explicitly deny 
));?> 

回答