display fields, or use WP function get_post_meta. Using get_post_meta will work even if plugin is removed or deactivated. $rows = get_post_meta( get_the_ID(), 'home_page_content', true ); if( !empty( $rows) ) { foreach( $rows as $count => $row ) { if ($row == 'hero') { // HERO $rows = get_post_meta( get_the_ID(), 'home_page_content', true ); if( !empty( $rows) ) { foreach( $rows as $count => $row ) { $hero_image = get_post_meta( get_the_ID(), 'home_page_content_' . $count . '_hero_image', true ); $image_src = wp_get_attachment_image_src( $hero_image, 'full'); if ($hero_image) { $bg = wp_get_attachment_image( $image, 'large' ); } $content = get_post_meta( get_the_ID(), 'home_page_content_' . $count . '_hero_text', true ); $display_cta_button = get_post_meta( get_the_ID(), 'home_page_content_' . $count . '_display_cta_button', true ); if ($display_cta_button) { $hero_button_url = get_post_meta( get_the_ID(), 'home_page_content_' . $count . '_hero_button_url', true ); $hero_button_text = get_post_meta( get_the_ID(), 'home_page_content_' . $count . '_hero_button_text', true ); echo '<p class="cta"><a class="button" href="' . $hero_button_url . '">' . $hero_button_text . '</a></p>'; } } } } elseif ($row == ‘services’) { // SERVICES … } } }