Call ACF data from functions.php [closed]

The functions.php file doesn’t know where you want that code to be shown on the front end. You need to put the code into a template page (ie the woocommerce account page) or attach it to that page with a woocommerce hook to the template.

You’ll need to add it into a function to properly work if you decide it’s better to leave it in your functions.php. In either case you may want to surround the while statement in an if statement in case there are no rows. Otherwise you’ll get errors.

Lastly since you’re echoing the field you should use

echo get_sub_field('email_group_id'); 

if you actually have more code than what you provided, and it’s in the options page i would add the “option” argument to the field as well:

while ( have_rows('group_email' , 'option') ) : the_row(); 
?>      
    <option>
<?php
     echo get_sub_field('email_group_id', 'option'); 
?>
    </option>
<?php

endwhile;

It may be worth trying that first.