get current user not working

I was trying this code to get current user info, but showing nothing. My WordPress version is 3.3.1 <?php wp_get_current_user(); /** * @example Safe usage: $current_user = wp_get_current_user(); * if ( !($current_user instanceof WP_User) ) * return; */ echo ‘Username: ‘ . $current_user->user_login . ‘<br />’; echo ‘User email: ‘ . $current_user->user_email . ‘<br />’; … Read more

How to echo billing phone number under My Account in Woocommerce? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 6 … Read more

How to get the user description with get_users?

I’m using this piece of code to list users and their information. The problem I’m having is that the description isn’t showing. Obviously it’s because the description lays under “user_meta” and not “users”. But how would I solve that? <?php $blogusers = get_users(‘include=2,3,4,5,6,7,8’); foreach ($blogusers as $user) { echo ‘<li>’ . get_avatar($user->ID, 120) . ‘<br … Read more

User meta conventions / name registry, for social media links

The Yoast WordPress-SEO plugin adds some social media links to user_meta: function update_contactmethods( $contactmethods ) { // Add Google+ $contactmethods[‘googleplus’] = __( ‘Google+’, ‘wordpress-seo’ ); // Add Twitter $contactmethods[‘twitter’] = __( ‘Twitter username (without @)’, ‘wordpress-seo’ ); // Add Facebook $contactmethods[‘facebook’] = __( ‘Facebook profile URL’, ‘wordpress-seo’ ); return $contactmethods; } using bare, namespace-less identifiers … Read more