Explain the importance of functions.php in a WordPress theme.

The functions.php file, also known as the theme functions file, allows developers to add custom code, functions, and actions to a WordPress theme. It can include functions to enqueue scripts, register custom post types, and define theme support for features like post thumbnails and menus.

// Enqueue styles and scripts
function theme_enqueue_styles() {
    wp_enqueue_style('style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'theme_enqueue_styles');