Lines:
1 to 100 of 115
<?php /** * Twenty Seventeen functions and definitions * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * * @package WordPress * @subpackage Twenty_Seventeen * @since Twenty Seventeen 1.0 */ /** * Twenty Seventeen only works in WordPress 4.7 or later. */ if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; return; } /* function twentyseventeen_setup() – Sets up theme defaults and registers support for various WordPress features. */ add_action( 'after_setup_theme', 'twentyseventeen_setup' ); /* function twentyseventeen_content_width() – Set the content width in pixels, based on the theme’s design and stylesheet. */ add_action( 'template_redirect', 'twentyseventeen_content_width', 0 ); if ( ! function_exists( 'twentyseventeen_fonts_url' ) ) : /* function twentyseventeen_fonts_url() – Register custom fonts. */ endif; /* function twentyseventeen_resource_hints() – Add preconnect for Google Fonts. */ // add_filter( 'wp_resource_hints', 'twentyseventeen_resource_hints', 10, 2 ); /* function twentyseventeen_widgets_init() – Register widget area. */ add_action( 'widgets_init', 'twentyseventeen_widgets_init' ); /* function twentyseventeen_excerpt_more() – Replaces "[. */ add_filter( 'excerpt_more', 'twentyseventeen_excerpt_more' ); /* function twentyseventeen_javascript_detection() – Handles JavaScript detection. */ add_action( 'wp_head', 'twentyseventeen_javascript_detection', 0 ); /* function twentyseventeen_pingback_header() – Add a pingback url auto-discovery header for singularly identifiable articles. */ add_action( 'wp_head', 'twentyseventeen_pingback_header' ); /* function twentyseventeen_colors_css_wrap() – Display custom color CSS. */ add_action( 'wp_head', 'twentyseventeen_colors_css_wrap' ); /* function twentyseventeen_scripts() – Enqueues scripts and styles. */ add_action( 'wp_enqueue_scripts', 'twentyseventeen_scripts' ); /* function twentyseventeen_block_editor_styles() – Enqueues styles for the block-based editor. */ add_action( 'enqueue_block_editor_assets', 'twentyseventeen_block_editor_styles' ); /* function twentyseventeen_content_image_sizes_attr() – Add custom image sizes attribute to enhance responsive image functionality for content images. */ add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 ); /* function twentyseventeen_header_image_tag() – Filters the `sizes` value in the header image markup. */ add_filter( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 ); /* function twentyseventeen_post_thumbnail_sizes_attr() – Add custom image sizes attribute to enhance responsive image functionality for post thumbnails. */ add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr', 10, 3 ); /* function twentyseventeen_front_page_template() – Use front-page.php when Front page displays is set to a static page. */ add_filter( 'frontpage_template', 'twentyseventeen_front_page_template' ); /* function twentyseventeen_widget_tag_cloud_args() – Modifies tag cloud widget arguments to display all tags in the same font size and use list format for better accessibility. */ add_filter( 'widget_tag_cloud_args', 'twentyseventeen_widget_tag_cloud_args' ); /* function twentyseventeen_unique_id() – Gets unique ID. */ if ( ! function_exists( 'wp_get_list_item_separator' ) ) : /* function wp_get_list_item_separator() – Retrieves the list item separator based on the locale. */ endif; /** * Implement the Custom Header feature. */ require get_parent_theme_file_path( '/inc/custom-header.php' ); /** * Custom template tags for this theme. */ require get_parent_theme_file_path( '/inc/template-tags.php' ); /** * Additional features to allow styling of the templates. */ require get_parent_theme_file_path( '/inc/template-functions.php' ); /** * Customizer additions. */