Skip to content

Instantly share code, notes, and snippets.

@braddalton

braddalton/functions.php

Last active Oct 10, 2020
Embed
What would you like to do?
Using get_post_meta In Replace of ACF the_sub_field https://wpsites.net/?p=96847
$repeater_value = get_post_meta( get_the_ID(), 'content_area_light_background', true);
if ( $repeater_value ) :
for ( $i = 0; $i < $repeater_value; $i++ ) {
$meta_key = 'content_area_light_background_' . $i . '_light_background_sub_field';
$sub_field_value = get_post_meta( get_the_ID(), $meta_key, true );
echo $sub_field_value;
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment