WordPress plugin for Limited days user
The Membership plugin does that pretty much out of the box, if i recall correctly. Not sure if only on the paid version, though.
The Membership plugin does that pretty much out of the box, if i recall correctly. Not sure if only on the paid version, though.
Removing the dashboard: /* Remove the “Dashboard” from the admin menu for non-admin users */ function wpse54085_remove_dashboard () { global $current_user, $menu, $submenu; get_currentuserinfo(); if( ! in_array( ‘administrator’, $current_user->roles ) ) { reset( $menu ); $page = key( $menu ); while( ( __( ‘Dashboard’ ) != $menu[$page][0] ) && next( $menu ) ) { $page … Read more
Try this code, but replace METAKEY to the key-name of your metadata. <?php function cmp( $a, $b ) { if( $a->METAKEY == $b->METAKEY ){ return 0 ; } return ($a->METAKEY < $b->METAKEY ) ? -1 : 1; } ?> <ul> <?php $args = array( ‘role’ => ‘author’ , ‘meta_key’ => ‘METAKEY’, ‘number’ => 5, ); … Read more
So here is the small snippet to show total number of users and all roles with user count. This code should go in the themes functions.php file. The code uses count_user function to fetch the array and show it up on Right Now dashboard screen. function wpse_60487_custom_right_now() { $users = count_users(); echo ‘<table><tbody>’; echo ‘<tr><td … Read more
I had been using TDO mini forms (free) plugin for quite some time, and it worked reasonably well, for our 12000 members. It has some limitations/bugs, and I think it is no longer really supported. Now I have switched to using Gravity Forms, (not free), it is perfect for subscribers to post from the frontend, … Read more
This thread at wordpress.org – http://wordpress.org/support/topic/content-shown-based-on-user-role – suggests using the ‘current_user_can’ function This thread – http://wordpress.org/support/topic/display-a-custom-image-only-if-user-role-is-contributor – suggests you can use it like ‘current_user_can(‘contributor’)’ for different roles. I haven’t tried it but it sounds like it should work.
Why do you not use the default function wp_login_form() for the login form, example: global $user_login; if (is_user_logged_in()) { echo __( ‘Hello’, ‘theme_text_domain’ ) . $user_login . ‘<a href=”‘ . wp_logout_url() . ‘” title=”‘ . __( ‘Logout’, ‘theme_text_domain’ ) . ‘”>’ . __( ‘Logout’, FB_BASIS_TEXTDOMAIN ) . ‘</a>’; } else { wp_login_form(); } the function … Read more
Use a multi-site installation (see our multisite tag), give each team its own sub-site on /team-name/ and use the master site for the rest. Advantages All users on a multi-site setup are stored in the same database, they don’t need a separate account for the main site. You can give each user a different role … Read more
$wpdb is a global variable for the database class. In it $wpdb->users points to the name of the users table. As long as it’s the same database, you can use this to change the name of the table but it might create errors if the schema doesn’t match. Another way is to extend the wpdb … Read more
// retrieve latest 5(or all) posts of this user $query = new WP_Query(array( ‘author’ => $author, ‘posts_per_page’ => 5 )); // skip the user if the number of posts is 0 if($query->post_count < 1) continue; // loop through available posts & display the title while($query->have_posts()) : $query->the_post(); the_title(); endwhile; wp_reset_query(); This code should go inside … Read more