0

I am using a static front page as a home page. In that some sections (like header text,etc.,) needs to manage at admin end. So that I decided use ACF(Advanced Custom Fields) plugin and create some custom fields for a private mode page, using the page id populate the content.

  • Can anyone suggest me whether shall I proceed with this step or any better solutions?
  • Will the private mode page also get index by search engines?
Antony
  • 171
  • 2
  • 11

1 Answers1

1

I would create an options page for that and specifically different sub-options pages (such as header/footer etc.)

This is done through their documented function:

    if( function_exists('acf_add_options_page') ) {

    // add parent
    $parent = acf_add_options_page(array(
        'page_title'    => 'Theme General Settings',
        'menu_title'    => 'Theme Settings',
        'redirect'      => false
    ));


    // add sub page
    acf_add_options_sub_page(array(
        'page_title'    => 'Header',
        'menu_title'    => 'Header',
        'parent_slug'   => $parent['menu_slug'],
    ));

}

You then create a field group for those, and in the dropdown of where to show such group you select that specific option sub page.

And then to access the fields you just use their function:

$field = get_field('field_name', 'option');

Remember field names need to be unique, prefixation is suggested.

Mel Macaluso
  • 3,250
  • 2
  • 12
  • 26