Output ACF repeater on frontend user’s profile page (created with Ultimate Member)

Question

I’m using Ultimate Member plugin to manage my user directory. I also use Advanced Custom Fields to create some custom fields on the backend of the user’s profile page (location: user form > equal > add/edit) which I want to output via shortcode on the profile page of the current user.

This is what I tried:

function acf_repeater() {

um_fetch_user( get_current_user_id() ); {

  if( have_rows('repeater_name') ):

    while ( have_rows('repeater_name') ) : the_row();

      the_sub_field('subfield_name');

    endwhile;

  else :

  endif;
  } 
}

add_shortcode('acf_repeater_shortcode', 'acf_repeater');

but this doesn’t work. Any tips?

0
, Chris Osiak 10 months 0 Answers 55 views 0

Leave an answer