Finally got it to work with some creativity
-
Tried according to the documentation, but did not work. Trying to get the $post_id will not work.
I have a very simple Options menu with a parent and two children. Set as save to This Post for all three. I have one set of custom fields showing up on the two children option pages.
I entered the fields on a child options page, saved, then tried to run some code:
Ex:
$post_id = get_options_page_id(‘parent-options-page-slug’);if ( have_rows( ‘repeater_field_name’, $post_id ) ):
while ( have_rows( ‘repeater_field_name’ , $post_id ) ): the_row();$episode = get_sub_field( ‘episode_field’);
echo ‘Episode ‘ . $episode;
Does not return anything. Does not work.
UPDATE:
Have to create a shortcode attribute to grab sub-page menu slug. After that, works for me.
- The topic ‘Finally got it to work with some creativity’ is closed to new replies.