Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: calling specific profile fields individually


John James Jacoby
Keymaster

@johnjamesjacoby

I recommend using the field name, just because it’s easier to keep track of…

Example…

<?php if ( $firstname = xprofile_get_field_data('First Name') ) : ?>
<h3><?php _e('First Name', 'your-theme-textdomain') ?></h3>
<div class="profile-data-field">
<?php echo $firstname ?>
</div>
<?php endif; ?>

…will get you the data from the field named “First Name” for the currently displayed user. If there is no user displayed (your account or anyone else’s), it will return false.

Skip to toolbar