How To Add An Options Page In ACF

Trying to add an options page to your WordPress website with Advanced Custom Fields? All you may need is to add a function to your WordPress theme’s functions.php file.

Registering the options page to ACF

To register the options page in ACF, you need to add a function to your WordPress theme’s functions.php file.

  1. Navigate to Appearance > Editor > Theme Functions from your WordPress Dashboard;
  2. Copy and paste in the function below;
  3. Click Update File to save the changes.
if ( function_exists( 'acf_add_options_page' ) ) {
 acf_add_options_page();
}

Configuring the ACF options page

To configure your options page in ACF, you must do the following stops below.

  1. Register the options page using the function in the previous step above;
  2. Navigate to Custom Fields > Add New;
  3. Under the Location section, select Options Page;
  4. Click Publish to save the new page.

Using ACF Options

To use ACF options, you can simply call the function below into your WordPress theme’s files.

the_field( 'example_options_page_field', 'option' );

This also works with get_field(); too;