Home › Forums › ACF PRO › Options Page And Menu › Reply To: Options Page And Menu
Something like this would do it
add_action('admin_menu', 'add_options_pages');
function add_options_pages() {
if (!function_exists('acf_add_options_page')) {
return;
}
acf_add_options_page(array('page_title' => 'Theme Options'));
// the following parent url will be auto generated by the above call
// you can change the slug by specifying a slug for the page
$parent = 'acf-options-theme-options';
$sub_options_pages = array('Header', 'Navigation', 'Banner', 'Etc');
foreach ($sub_options_pages as $title) {
acf_add_options_sub_page(array('title' => $title, 'parent' => $parent));
}
}
edited, didn’t need $options_page =
on this line acf_add_options_page(array('page_title' => 'Theme Options'));'
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.