• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / functions.php


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 */
endif;
 

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      1 to 1 of 1
      • twenty_twenty_one_customize() – Prevents the Customizer from being loaded on WordPress versions prior to 5.3.

      Call hooks

      File name: functions.php
      Plugin ref: Twenty Twenty-One
      Version: 1.7
      Deprecated?: No
      API Letters: F,P

      Published: 9th December 2020 | Last updated: 9th June 2022

      Primary Sidebar

      Information

      File name: functions.php
      Plugin ref: Twenty Twenty-One
      Version: 1.7
      Deprecated?: No
      API Letters: F,P

      Footer

      WordPress a2z
      WordPress a2z
      WordPress Dynamic API Reference
      WordPress 6.1.1. PHP: 8.0.27
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  wp-a2z.org
      © Copyright WordPress a2z 2014-2023. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites