Hot answers tagged


Basically to log a user in you can use: //Login the user $creds = array(); $creds['user_login'] = $login; $creds['user_password'] = $password; if ( !empty( $remember ) ){ $creds['remember'] = true; } $user = wp_signon( $creds, true ); but that is only when you have the password and login so you can create your ...


Modify a registered style's path I wanted to tweak the path to one of the WordPress admin stylesheets so i could keep requests down, and because it makes little sense to include two stylesheets, when the one i'm calling redefines all the styling in the stylesheet enqueued by WordPress. The idea is basically to re-point the existing style at a different ...


There is no way to do this based on registered vs unregistered status because all users are anonymous until they log in. If you mean "logged in" vs "not logged in" then ... if (is_user_logged_in()) { // logged in content } else { // not logged in content } Reference:


There's not an ideal place to hook into the registration process. I think there's a strong case to add a user registration event action hook to core. But I think you might be able to fake it, in the mean-time. One of the last things that happens when a user successfully registers, is the creation of a user option named 'default_password_nag'. We can create ...


You can use the filter wp_admin_css_uri in the function of the same name which returns the uri of the admin css files. E.g.: function custom_modify_styles( $_file, $file ) { if( 'style' == $file ) // $file = css filename without extension $_file = 'my/new/path/to/style.css'; return $_file; } add_action( 'wp_admin_css_uri', '...


Rarst's solution is indeed the simplest way to do it and the Members plugin also has heaps of other advantages. You can also do it without a plugin, by using the is_user_logged_in() function More info on and


Home page only or whole site?.. I assume latter as it makes more sense. The simplest way I know is to use Members plugin and enable Private Blog option it has.


Before you begin, you should know that sending mass emails is a delicate subject matter, and your hosting provider or mail provider has certain guidelines about this. Some hosting providers, such as Dreamhost, provide "Announcement Lists", which act as a platform for writing newsletters (or essentially emailing a large group of subscribers). Sending ...


That sounds like a useful feature. To get what you need you have to change three things: Add a checkbox to enable anonymous comments per post. Save the checkbox value together with the post. Filter the checks for the comment registration requirement on the post views to enable the comment form and on the actual comment save action to let them go through. ...


Comments that are left by registered users are given the class "byuser" - so you can create a style in your theme's stylesheet to point out these comments. Something like: .commentlist li.byuser { background:#FF0000; } That would make the background of users' comments red (insert a more appropriate color). If you are not using a custom theme, I'...


Hi @Robin I Knight: Have you tried this? <?php echo get_user_meta($current_user->ID,'user_post_code',true);?>

Only top voted, non community-wiki answers of a minimum length are eligible