Hi I have tried your code and it works when you do like below:
$user_id = get_current_user_id(); // this will give user id of current loged in user
// or try using this to get author ID related to your post, this will give $user_id of post author
$temp_post = get_post($post_id);
$user_id = $temp_post->post_author;
var_dump(get_the_author_meta( 'twitter', $user_id ));
similarly for other fields, please replace in your code accordingly:
get_the_author_meta('googleplus',$user_id)
get_the_author_meta('facebook',$user_id)
get_the_author_meta('linkedin',$user_id)
For details Please follow get_the_author_meta codex
For more details please follow this link get_the_author_meta developer
I think we need to pass $user_id
when need to use outside the loop.
Thanks!
Related Posts:
- Make WooCommerce pages accessible for logged in users only
- Ban a user and end their session
- How to limit users to one comment per post
- Is there an upper limit for users in WP?
- How to let user set password on registration
- How to get the Gravityform entry ID from current user’s form submission? [closed]
- Post list based on the user that is logged in
- Extending WP_User class and using this sub-class during the whole lifecycle
- Why does is_user_logged_in() return false after redirect from another site?
- How can I add a user through SQL?
- Copy a user from one WordPress site to another
- Count user posts by type and date
- Assigning tags to user?
- How to use tinyMCE for user “biographical info” without messing with any core file?
- Get user info outside WordPress
- How to change the order in which users are displayed in admin?
- Total number of authors with more than one post
- WordPress has a trash for users? (Wrong result for count_user, greater than expected)
- Is there a simple way to manage capabilities per user?
- How Do I Prevent Junk Account Creation?
- Hide a user from WordPress
- Check for user meta data at Login
- Buddypress – Send New User Activation Link to Admin [closed]
- Redirect after users complete profile form
- Cannot set user passwords
- Memory usage for scalable usermeta queries
- How to get current user’s phone number
- How can I retrieve current user id within wordpress plugin?
- Front End Registration Form Code – Password Field Not Saving
- How can I verify users facebook ID that he provides during signup process
- How do I customize the dashboard?
- Generate unique number when registering a new user
- WordPress User Meta & ChromePHP or other way to debug/view php variables
- How would I hook into `clear_auth_cookie` to return the user’s ID that’s currently being logged out?
- New users not showing up in Post -> Edit
- How can i change the name order in the admin?
- Getting author page slug from get_users() or get_userdata() functions
- WP_User_Query by meta_value with Number returns nothing
- How to add user from front end
- Rewrite Rules and Login Issue
- User profile updates password even if not filled (Theme my login) in Firefox? [closed]
- Preventing auto-filling of e-mail addresses on profile.php
- users and usermeta table
- Getting the age of a users account
- Prevent subscribers to changing certain profile fields
- New user form rejected because “passwords don’t match”—but there’s only one password field
- Unable to change email address of admin on localhost
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- Creating User Profiles using author.php
- “the_author_meta(‘url’)” not working inside “href”
- REST API: wp_get_current_user not working on second call
- How to let the users edit their user names?
- How do I filter users based on email address?
- What’s the correct way to add capabilites to user roles?
- Web app vs CMS backend
- User roles not displaying
- Allow admins to login as other users
- How to count total words for posts published by one author?
- Should I setup frontend-only users as CPT or use a plug-in?
- How to expire user registration?
- Delete a user from frontend
- Echo a list of all subscriber’s user IDs
- user login and its profile
- wp_delete_user – huge overhead in Buddypress?
- Get current logged-in user from external site
- Delete all users with Editor role and their content mysql
- Load Custom Field to User Profile as per User Role using Ajax
- Show posts who published after registration date
- How to hide “Change role to” dropdown on Users admin menu
- Get UserInfo from WordPress
- How to display a calendar with events depending on the user?
- How to show different pages for different users
- How can i display pagination in custom comment list?
- hide page menu from admin panel for specific users
- Single Sign On (SSO) between two WordPress websites
- Disabling user capability to edit_posts or delete_posts in the front-end
- Redirect /member/ to /member/user
- get user id in a plugin without a function
- $user_login is not working if author has only 1 post
- WP_User object behaving strangely when used inside Admin Panel?
- REST_query_vars for users
- How to use a transient inside WP_User_Query
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- List all users based on array of domains
- Add method for tracking who referred new users
- Resend user activation mail
- Cloning admin pages like users.php
- User count only for role frontend vendor
- Changing user_login ends current session
- Using and saving custom dropdown boxes on user profiles
- Giving users an editable homepage/business directory
- Buddypress – New user type with no profile and can’t interact but can be admin of a group
- How to create front-end (editable) WordPress user profile pages?
- Securely log in a user without a password using a link?
- Store subscription details for users in WordPress
- Disable editing profile for second time
- No one can edit post/pages by Administrator
- How to add custom detail page for a Subscriber at Admin Panel
- Wordpres password as plain text in email