Support

Account

Home Forums General Issues Custom field in registration form + show it in user profile page

Helping

Custom field in registration form + show it in user profile page

  • Hi,

    I find out that you can add an extra field in the WP default registration form with ACF, and that is awesome. But what I can’t figure out is how to show that collected data in the user profile page.

    I did some research in Google but without succeed.
    Maybe you can help me out.

    * The field I’m adding is for upload a file (PDF), and I would like that file shows attached to the user profile page (as a link to download it for example).
    * I would like to avoid to use other plugins.

  • Hi @dedalos-01

    <?php
    if ( is_user_logged_in() ) :
    
    	$user_id = get_current_user_id();
    	$file= get_field( 'file', "user_".$user_id );
    	if($file): ?>
    		<a href="<?php echo $file['url']; ?>"><?php echo $file['filename']; ?></a>	
    	<?php endif;
    
    endif;
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.