Lines:
1 to 86 of 86
<?php /** * Functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Twenty_One * @since Twenty Twenty-One 1.0 */ // This theme requires WordPress 5.3 or later. if ( version_compare( $GLOBALS['wp_version'], '5.3', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; } if ( ! function_exists( 'twenty_twenty_one_setup' ) ) { /* function twenty_twenty_one_setup() – Sets up theme defaults and registers support for various WordPress features. */ } add_action( 'after_setup_theme', 'twenty_twenty_one_setup' ); /* function twenty_twenty_one_widgets_init() – Register widget area. */ add_action( 'widgets_init', 'twenty_twenty_one_widgets_init' ); /* function twenty_twenty_one_content_width() – Set the content width in pixels, based on the theme’s design and stylesheet. */ add_action( 'after_setup_theme', 'twenty_twenty_one_content_width', 0 ); /* function twenty_twenty_one_scripts() – Enqueue scripts and styles. */ add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_scripts' ); /* function twentytwentyone_block_editor_script() – Enqueue block editor script. */ add_action( 'enqueue_block_editor_assets', 'twentytwentyone_block_editor_script' ); /* function twenty_twenty_one_skip_link_focus_fix() – Fix skip link focus in IE11. */ add_action( 'wp_print_footer_scripts', 'twenty_twenty_one_skip_link_focus_fix' ); /* function twenty_twenty_one_non_latin_languages() – Enqueue non-latin language styles */ add_action( 'wp_enqueue_scripts', 'twenty_twenty_one_non_latin_languages' ); // SVG Icons class. require get_template_directory() . '/classes/class-twenty-twenty-one-svg-icons.php'; // Custom color classes. require get_template_directory() . '/classes/class-twenty-twenty-one-custom-colors.php'; new Twenty_Twenty_One_Custom_Colors(); // Enhance the theme by hooking into WordPress. require get_template_directory() . '/inc/template-functions.php'; // Menu functions and filters. require get_template_directory() . '/inc/menu-functions.php'; // Custom template tags for the theme. require get_template_directory() . '/inc/template-tags.php'; // Customizer additions. require get_template_directory() . '/classes/class-twenty-twenty-one-customize.php'; new Twenty_Twenty_One_Customize(); // Block Patterns. require get_template_directory() . '/inc/block-patterns.php'; // Block Styles. require get_template_directory() . '/inc/block-styles.php'; // Dark Mode. require_once get_template_directory() . '/classes/class-twenty-twenty-one-dark-mode.php'; new Twenty_Twenty_One_Dark_Mode(); /* function twentytwentyone_customize_preview_init() – Enqueue scripts for the customizer preview. */ add_action( 'customize_preview_init', 'twentytwentyone_customize_preview_init' ); /* function twentytwentyone_customize_controls_enqueue_scripts() – Enqueue scripts for the customizer. */ add_action( 'customize_controls_enqueue_scripts', 'twentytwentyone_customize_controls_enqueue_scripts' ); /* function twentytwentyone_the_html_classes() – Calculate classes for the main <html> element. */ /* function twentytwentyone_add_ie_class() – Add "is-IE" class to body if the user is on Internet Explorer. */ add_action( 'wp_footer', 'twentytwentyone_add_ie_class' ); if ( ! function_exists( 'wp_get_list_item_separator' ) ) : /* function wp_get_list_item_separator() – Retrieves the list item separator based on the locale. */ endif;