Hot answers tagged

2

There is the action hook user_register that is called immediately after a user is added to the database. The user id is passed to the hook as an argument. You can use wp_insert_post to insert a new post in that action. You just need to get the relevant info from the user and add it to the post. You can add custom fields to the post you create by referencing ...


1

You didn't add any code (make sure you add your own code next time because nobody bothers to help you if we have to guess the problem) but Im pretty sure I know what's wrong. Straight out of the WordPress codex: echo get_avatar( $user_id_or_email, $avatar_size, $default_avatar, $alt_text, $args ); You have to echo it because get_avatar() doesn't ...


1

This is how you can get current user: global $current_user; $current_user = wp_get_current_user(); After that, you can use $current_user->ID where you want. Example: if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); echo 'Username: ' . $current_user->user_login . '--'; echo 'User email: ' . ...


1

Prior to Wordpress 4.5 get_currentuserinfo() was an acceptable option, but is now deprecated, in favor of wp_get_current_user(). You can set the wp_get_current_user() as a variable to easily access it in your function or page: $current_user = wp_get_current_user(); Example: if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); ...


1

To just answer this question.. Hope it's okay to pull this back up ^^ <div class="profile-bio"> <!-- Profile user info bio text --> <?php if ( $string = xprofile_get_field_data( 'About', get_the_author_meta('ID') ) ) { echo '<div class="author-about">'; ...


1

Alright, there's a few things that isn't standardized WordPress so I've put together a minimal script which I'll explain piece by piece. Hopefully clear things up for you by the time you get to the end. HTML Form Below is a very simple HTML form. We're going to use javascript to listen for submission and stop it from actually refreshing the page but that ...



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