Support

Account

Forum Replies Created

  • Update:

    So far I have been able to find a way to pull in the name and gravatar image. However instead of the gravatar I want to be able to pull the image the user set on a subfield within a repeater. My users have a front-end form they setup for their profile, and there user image is what I want to pull in.


    Currently working, not ideal:

    
    $profilepic = get_sub_field('picture' );
    $users = get_field("florida");
    ?>
    
    <div class="avatar">
    	   <span>
     <?php
    $user = wp_get_current_user();
    
    if ( $user ) :
        ?>
        <img src="<?php echo esc_url( get_avatar_url( $user->ID ) ); ?>" />
    <?php endif; ?>
    	  </span>
      </div>
    
    <div class="avatar-details">
           <span>
                <?php if( $users ): ?>
                  <?php foreach( $users as $user ): ?>
                <a href="<?php echo esc_attr($user->user_url); ?>"><?php echo $user->display_name; ?></a>
          </span>
              <?php endforeach; ?>
            </div>
    <?php endif; ?>
    

    Almost working? :

    
    $users = get_field("florida");
    ?>
    
    <div class="avatar">
    	<?php if( have_rows('contact_details', 'user_'. $author_id )): ?>
        <div>
    		<?php while ( have_rows('contact_details', 'user_'. $author_id )): the_row();
    			$author_id = get_the_author_meta('ID');
                $profilepic = get_sub_field('picture', 'user_'. $author_id ); ?>
    		<span>
    	 <img src="<?php echo $profilepic; ?>" />
       </span>
    			<?php endwhile; ?>
    			<?php endif; ?>
    
     </div>
    
    <div class="avatar-details">
             <span>
               <?php if( $users ): ?>
                 <?php foreach( $users as $user ): ?>
               <a href="<?php echo esc_attr($user->user_url); ?>"><?php echo $user->display_name; ?></a>
         </span>
             <?php endforeach; ?>
           </div>
    <?php endif; ?>
    

    So i think the issue is it doesen’t see the rows, so anything after <?php if( have_rows('contact_details', 'user_'. $author_id )): ?> seems to get removed and doesent show within inspect?

Viewing 1 post (of 1 total)