I am new to wordpress development. I was trying to solve the problem of adding extra fields to my wordpress user profile area. I achieved this with a plugin. How do I call the value of these fields on my custom dashboard page template for logged in users, like so: <a href=""><?php echo $profile_field_name ?></a>
.
0
votes
What plugin you have used to add custom fields?
– jogesh_pi
@jogesh_pi, I used Profile Extra fields plugin
– Nnah Kenneth
1 Answers
1
votes
You can use get_user_meta Function. for exp in your case :
$profile_field_name = '';
if (get_user_meta( $user_id, 'profile_field_name', true )){
$profile_field_name = get_user_meta( $user_id, 'profile_field_name', true );
};
then you can echo like your example :
<a href=""><?php echo $profile_field_name ?></a>