Support » Plugin: ACF Options Page Admin » 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.

    • This topic was modified 1 year, 2 months ago by zdmdesigns.
    • This topic was modified 1 year, 2 months ago by zdmdesigns.
    • This topic was modified 1 year, 1 month ago by zdmdesigns.
    • This topic was modified 1 year, 1 month ago by zdmdesigns.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Got it to work, but I had to create a shortcode attribute first that matched the child page slug and insert that as the get_options_page_id. Not really a seamless solution.
    Pain in the butt…

    • This reply was modified 1 year, 2 months ago by zdmdesigns.
    Plugin Author John Huebner

    (@hube2)

    Sorry if you’re having an issue with the plugin. It sounds like the problem here is that you have a parent options page and a child options page. You are trying to get the options from the child options page by using the parent options page slug to get the ID. This will not work. You would need to get the child options page ID.

    Would have been nice if you opened a support topic so I could help you with the issue and fix any bugs instead of immediately giving the plugin a poor rating.

    • This reply was modified 1 year, 2 months ago by John Huebner.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Finally got it to work with some creativity’ is closed to new replies.