• Hi wondering why this won’t work on any page
    `
    function members_func( $atts ){

    ob_start();

    // check if the repeater field has rows of data
    if( have_rows(‘new_member’) ):
    // loop through the rows of data
    while ( have_rows(‘new_member’) ) : the_row();
    // display a sub field value
    the_sub_field(‘member_name’);
    endwhile;
    else :
    // no rows found
    endif;
    return ob_get_clean();
    }
    add_shortcode( ‘members’, ‘members_func’ );

    Do I have to put in a page id or something for it to work? I tried the custom post id and that didn’t work.

The topic ‘Repeater fields won’t show in shortcode’ is closed to new replies.