Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Can’t get it to work

$
0
0

Replies: 1

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.

  • This topic was modified 1 hour, 20 minutes ago by zdmdesigns.
  • This topic was modified 1 hour, 15 minutes ago by zdmdesigns.

Viewing all articles
Browse latest Browse all 59525

Trending Articles