displaying custom code on a given users profile page

Assuming you are in the back-end (admin), so the user profile page is being rendered by /wp-admin/user-edit.php – there is a global variable that indicates the id of the user whose profile we are on. If you look at the source code for user-edit.php you can see it guarantees (or will die) the existence of … Read more

Drop down list in user profile page

thanks for that. Just one minor tweak, as the first bit of code threw up an error. Below is the working code for the first block of code. //hooks add_action( ‘show_user_profile’, ‘Add_user_fields’ ); add_action( ‘edit_user_profile’, ‘Add_user_fields’ ); function Add_user_fields( $user ) { ?> <h3>Extra fields</h3> <table class=”form-table”> <tr> <th><label for=”text”>text</label></th> <td> <?php // get test … Read more

How can I access profile Admin Colour Scheme

The current active/selected admin color scheme is a user setting, you can get its value with get_user_option( ‘admin_color’ ). $admin_color = get_user_option( ‘admin_color’ ); if you want to access the color scheme for the specific user then pass the user id as second parameter in the get_user_option() function $user1_id = 2; $user1_color = get_user_option( ‘admin_color’, … Read more

the_author_meta not working

It’s entirely possible that you are calling the_author_meta() from outside of your post loop in the author.php template in which case the above will not work. Instead, you can use get_the_author_meta(‘facebook’) or… get_the_author_meta(‘facebook’, $user_id) where $user_id is the ID# of the current user/author. To get the user ID you can do this; <div class=”user_social_icons”> <a … Read more