__(‘Primary Menu’),
‘footer-menu’ => __(‘Footer Menu’),
]);
}
add_action(‘init’, ‘my_theme_register_menus’);
// Aggiungi il supporto per i loghi personalizzati
function my_theme_custom_logo() {
add_theme_support(‘custom-logo’, [
‘height’ => 100,
‘width’ => 400,
‘flex-height’ => true,
‘flex-width’ => true,
]);
}
add_action(‘after_setup_theme’, ‘my_theme_custom_logo’);
// Carica gli script e gli stili del tema
function my_theme_enqueue_scripts() {
wp_enqueue_style(‘theme-style’, get_stylesheet_uri());
wp_enqueue_script(‘theme-scripts’, get_template_directory_uri() . ‘/js/scripts.js’, [], false, true);
}
add_action(‘wp_enqueue_scripts’, ‘my_theme_enqueue_scripts’);
// Aggiungi una sezione personalizzata al personalizzatore
function my_theme_customize_register($wp_customize) {
$wp_customize->add_section(‘my_theme_colors’, [
‘title’ => __(‘Theme Colors’),
‘priority’ => 30,
]);
$wp_customize->add_setting(‘header_color’, [
‘default’ => ‘#000000’,
‘transport’ => ‘refresh’,
]);
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, ‘header_color’, [
‘label’ => __(‘Header Color’),
‘section’ => ‘my_theme_colors’,
‘settings’ => ‘header_color’,
]));
}
add_action(‘customize_register’, ‘my_theme_customize_register’);
?>