Home › Forums › Add-ons › Options Page › Custom option page isn't showing › Reply To: Custom option page isn't showing
I see where your problem is. Take a look here and see the difference between the 2 examples i put below
Yours says this….
if( function_exists(‘acf_add_options_page’) ) {
acf_add_options_page(array(
‘page_title’ => ‘Image Settings’,
‘menu_title’ => ‘Image Settings’,
‘menu_slug’ => ‘theme-image-settings’,
‘capability’ => ‘edit_posts’,
‘icon_url’ => ‘dashicons-images-alt’,
‘position’ => 7,
‘redirect’ => true
));
acf_add_options_sub_page(array(
‘page_title’ => ‘Ads’,
‘menu_title’ => ‘Ads’,
‘parent_slug’ => ‘theme-image-settings’,
));
acf_add_options_sub_page(array(
‘page_title’ => ‘Theme Images’,
‘menu_title’ => ‘Theme Images’,
‘parent_slug’ => ‘theme-image-settings’,
));
}
so the 2 sub pages are slugged the same as rthe parent.
try it like this
if( function_exists(‘acf_add_options_page’) ) {
acf_add_options_page(array(
‘page_title’ => ‘Theme Options’,
‘menu_title’ => ‘Theme Options’,
‘menu_slug’ => ‘theme-options’,
‘compatibility’ => ‘edit_posts’,
‘parent_slug’ => ”,
‘position’ => ‘3’,
‘icon_url’ => ‘dashicons-admin-generic’,
)); **<- this gives the options panel it is THE parent
acf_add_options_sub_page(array(
‘page_title’ => ‘Image Settings’,
‘menu_title’ => ‘Image Settings’,
‘menu_slug’ => ‘theme-options-image’, < See “options” “image”
‘capability’ => ‘edit_posts’,
‘parent_slug’ => ‘theme-options’, <- See parent slug
‘position’ => ‘false’,
‘icon_url’ => ‘false’,
)); **<–this would be a child
acf_add_options_sub_page(array(
‘page_title’ => ‘Ads’,
‘menu_title’ => ‘Ads’,
‘menu_slug’ => ‘theme-options-ad’, <- See options ad
‘capability’ => ‘edit_posts’,
‘parent_slug’ => ‘theme-options’, <- See parent slug
‘position’ => ‘false’,
‘icon_url’ => ‘false’,
));
acf_add_options_sub_page(array(
‘page_title’ => ‘Theme Images’,
‘menu_title’ => ‘Theme Images’,
‘menu_slug’ => ‘theme-options-images’, <- See options images
‘compatibility’ => ‘edit_posts’,
‘parent_slug’ => ‘theme-options’, < see parent slug here
‘position’ => ‘false’,
‘icon_url’ => ‘false’,
));
}
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.