Show menu in sidebar if on specific page AND specific user role (is_page, current_user_can)

Changed the code in functions.php to this: function get_user_role() { global $current_user; $user_roles = $current_user->roles; $user_role = array_shift($user_roles); return $user_role; } And in the sidebar.php: <?php if (is_page(array(‘page1’)) && get_user_role(‘Administrator’)) : echo ‘<div class=”widget-title”>Title 1</div>’ . wp_nav_menu(array(‘theme_location’=>’menu1’ )); elseif (is_page(array(‘page2’))) : echo ‘<div class=”widget-title”>Page 2</div>’ . wp_nav_menu(array(‘theme_location’=>’menu2’ )); elseif (is_page(array(‘page 3’))) : echo ‘<div class=”widget-title”>Page … Read more

Allow a user to edit their own page and profile only

Read the WordPress Codex on the subject of Roles http://codex.wordpress.org/Roles_and_Capabilities To confirm that the system works the way you want, as an admin create a test member with the author role and sample content as you would for a ‘real’ member. Then sign out and sign in using your test member’s credentials and see what … Read more

List of users with email and role

That’s the correct way to get what you need. Though I’m not sure why WordPress returns an array of roles since ( to my knowledge ) you can only have 1 role at a time. Roles being an array you can modify by just retrieving the role index 0: $blogusers = get_users(); // Array of … Read more

WordPress multisite, allow non super admins to create sites

In multisite installation there already is a default admin and super-admin role, and if standard capabilities are different than what you want you can modify them: A default set of capabilities is pre-assigned to each role, but other capabilites can be assigned or removed using the add_cap() and remove_cap() functions. New roles can be introduced … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)