Lines:
1 to 100 of 121
<?php /** * Twenty Fifteen functions and definitions * * Set up the theme and provides some helper functions, which are used in the * theme as custom template tags. Others are attached to action and filter * hooks in WordPress to change core functionality. * * When using a child theme you can override certain functions (those wrapped * in a function_exists() call) by defining them first in your child theme's * functions.php file. The child theme's functions.php file is included before * the parent theme's file, so the child theme functions would be used. * * @link https://developer.wordpress.org/themes/basics/theme-functions/ * @link https://developer.wordpress.org/themes/advanced-topics/child-themes/ * * Functions that are not pluggable (not wrapped in function_exists()) are * instead attached to a filter or action hook. * * For more information on hooks, actions, and filters, * {@link https://developer.wordpress.org/plugins/} * * @package WordPress * @subpackage Twenty_Fifteen * @since Twenty Fifteen 1.0 */ /** * Set the content width based on the theme's design and stylesheet. * * @since Twenty Fifteen 1.0 */ if ( ! isset( $content_width ) ) { $content_width = 660; } /** * Twenty Fifteen only works in WordPress 4.1 or later. */ if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; } if ( ! function_exists( 'twentyfifteen_setup' ) ) : /* function twentyfifteen_setup() – Sets up theme defaults and registers support for various WordPress features. */ endif; // twentyfifteen_setup() add_action( 'after_setup_theme', 'twentyfifteen_setup' ); /* function twentyfifteen_widgets_init() – Register widget area. */ add_action( 'widgets_init', 'twentyfifteen_widgets_init' ); if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) : /* function twentyfifteen_fonts_url() – Register Google fonts for Twenty Fifteen. */ endif; /* function twentyfifteen_javascript_detection() – JavaScript Detection. */ add_action( 'wp_head', 'twentyfifteen_javascript_detection', 0 ); /* function twentyfifteen_scripts() – Enqueue scripts and styles. */ add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); /* function twentyfifteen_block_editor_styles() – Enqueue styles for the block-based editor. */ add_action( 'enqueue_block_editor_assets', 'twentyfifteen_block_editor_styles' ); /* function twentyfifteen_resource_hints() – Add preconnect for Google Fonts. */ add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 ); /* function twentyfifteen_post_nav_background() – Add featured image as background image to post navigation elements. */ add_action( 'wp_enqueue_scripts', 'twentyfifteen_post_nav_background' ); /* function twentyfifteen_nav_description() – Display descriptions in main navigation. */ add_filter( 'walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4 ); /* function twentyfifteen_search_form_modify() – Add a `screen-reader-text` class to the search form’s submit button. */ add_filter( 'get_search_form', 'twentyfifteen_search_form_modify' ); /* function twentyfifteen_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', 'twentyfifteen_widget_tag_cloud_args' ); /* function twentyfifteen_author_bio_template() – Prevents `author-bio.php` partial template from interfering with rendering an author archive of a user with the `bio` username. */ add_filter( 'author_template', 'twentyfifteen_author_bio_template' ); /** * Implement the Custom Header feature. * * @since Twenty Fifteen 1.0 */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. *