I've written this code in functions.php to add a section to my theme personalization.
But when I want to open "localhost/wordpress/wp-admin/customize.php?theme=eye-theme" to see my result, I see this error:
<blockquote>
Fatal error: Call to a member function
on a non-object in C:\xampp\htdocs\xampp\wordpress\wp-includes\class-wp-customize-control.php on line 233
</blockquote>
This is my <strong>functions.php</strong>:
But when I want to open "localhost/wordpress/wp-admin/customize.php?theme=eye-theme" to see my result, I see this error:
<blockquote>
Fatal error: Call to a member function
Code:
check_capabilities()
</blockquote>
This is my <strong>functions.php</strong>:
Code:
<?php
function eyetheme_register_theme_customizer($wp_customizer) {
$wp_customizer->add_section(
'eyetheme_display_options',
array(
'title' => 'Display Options',
'priority' => 200
)
);
$wp_customizer->add_setting(
'eyetheme_link_color',
array(
'default' => '#000000',
'transport' => 'postMessage'
)
);
$wp_customizer->add_control(
'eyetheme_link_control',
array(
'section' => 'eyetheme_display_options',
'label' => 'Link Color',
'type' => 'text'
)
);
}
add_action('customize_register', 'eyetheme_register_theme_customizer');