So I have a Custom Post Type called members. to this custom post type, I have ACF linked with a form to make an account In this post type are users made and stored.
Now I want to retrieve all members stored inside the post-type and display them inside a template page.
the code I have inside functions.php for the custom post type is:
function init_members() {
$labels = array(
'name' => 'Members',
'singular_name' => 'Member',
'menu_name' => 'Members',
'name_admin_bar' => 'Member',
'add_new' => 'New member',
'add_new_item' => 'New member',
'new_item' => 'New member',
'edit_item' => 'Edit member',
'all_items' => 'All members',
'search_items' => 'search member',
'not_found' => 'No members found',
'not_found_in_trash' => 'No members found in trash'
);
$args = array(
'labels' => $labels,
'public' => true,
'exclude_from_search' => true,
'rewrite' => array('slug' => 'lid'),
'has_archive' => false,
'supports' => array('title'),
'show_in_rest' => true,
'menu_icon' => 'dashicons-groups'
);
register_post_type('members', $args);
}
add_action('init', 'init_members');
So how do I get the member names from the custom post type with ACF to display on the template page