How to Create and Use an ACF Options Page in Oxygen Builder

Advanced Custom Fields has a somewhat hidden feature called an Options page. This allows you to create global fields for commonly reused fields logo phone number, logo, sitewide notices, and much more. The flexibility thanks to the fact that you design what you need using a normal field group is incredibly powerful.

In this video, I'll show you how to create an options page, create a few fields groups, and get them to show in Oxygen Builder. Let me know what you'll use your Options pages for.

Learn more about my Oxygen Builder course here: https://permaslug.com/ultimate-oxygen-course/

TCT Code Snippet:

function tct_field($field_name) {
    return get_field( $field_name, 'option' );
}

function tct_field_link($field_name) {
    //return str_replace(' ', '', get_field( $field_name, 'option' ));   
    return preg_replace("/[^0-9]/", "", get_field( $field_name, 'option' ) );
}

ACF Options Code Snippet: https://www.advancedcustomfields.com/resources/options-page/

if( function_exists('acf_add_options_page') ) {
    
    acf_add_options_page(array(
        'page_title' 	=> 'Theme General Settings',
        'menu_title'	=> 'Theme Settings',
        'menu_slug' 	=> 'theme-general-settings',
        'capability'	=> 'edit_posts',
        'redirect'		=> false
    ));
    
    acf_add_options_sub_page(array(
        'page_title' 	=> 'Theme Header Settings',
        'menu_title'	=> 'Header',
        'parent_slug'	=> 'theme-general-settings',
    ));
    
    acf_add_options_sub_page(array(
        'page_title' 	=> 'Theme Footer Settings',
        'menu_title'	=> 'Footer',
        'parent_slug'	=> 'theme-general-settings',
    ));
    
}

 

Signup For Emails

Want to be notified when new tutorials are released? Signup below for our roundup emails. We promise not to spam and won't blow up your inbox. 
  • This field is for validation purposes and should be left unchanged.
Jonathan Jernigan, Founder
Permaslug and APEX Web Solutions

Join Permaslug

Membership Benefits Include:

  • Ultimate Oxygen Course
  • Ultimate Woocommerce Course
  • ACF Pro Course
  • Material Design Lite
  • Template Downloads
  • Community
  • And more!
register

More Posts

Easiest Way to Install Custom Fonts in Oxygen Builder

Installing custom fonts can be tricky or require paid 3rd party plugins to do it reliably. This amazing code snippet from Matthias Altmann provides a super easy and quick solution to installing custom fonts in…
READ post

How to Fix Google Maps in Oxygen Builder

The deprecation of a Google Maps API caused Maps to break on most Oxygen sites, so we're going to cover the fix that was released and what you need to do to get your maps…
READ post

Use Selector Detector to Style Almost Anything in Oxygen Builder

In this tutorial, we're taking a look at a somewhat hidden feature of Oxygen Builder called Selector Detector. This amazing little utility allows you to pick out CSS selectors and style them using the Oxygen…
READ post
menu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram