WordPress error “You do not have sufficient permissions to access this page.” on adding a theme option page

Solution:1

Order your code at this way:

 

add_action(‘admin_menu’, ‘vc_add_theme_settings_pages’);

add_action(‘admin_head’, ‘theme_styles’);

add_action(‘admin_init’, ‘vc_add_theme_settings_page’);

 

function vc_add_theme_settings_page(){

    add_theme_page(‘Theme Settings’,’Theme Settings’, ‘edit_theme_options’, ‘manage_options’, ‘vc_theme_page_display’ );

}

and try change

 

<?php do_settings_sections(‘vc_theme_page’); ?>

for

<?php do_settings_sections(__FILE__); ?>

Solution:2

 add_action('admin_init', 'vc_add_theme_settings_page'); //instead of this
  add_action('admin_menu', 'vc_add_theme_settings_page'); //try this

Hope it will work for you.