Support

Account

Home Forums Front-end Issues How to show user-data on frontend for 'current-user' instead of userid Reply To: How to show user-data on frontend for 'current-user' instead of userid

  • This code may help you:

    <?php
    
    // get the current user id
    $id = get_current_user_id();
    
    // get a field from the user
    $variable = get_field('field_name', "user_{$id}");
    
    ?>
    <!-- Display the field from the user -->
    <p><?php the_field('field_name', "user_{$id}"); ?></p>