Lines:
1 to 100 of 127
<?php /** * Twenty Fourteen 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_Fourteen * @since Twenty Fourteen 1.0 */ /** * Set up the content width value based on the theme's design. * * @see twentyfourteen_content_width() * * @since Twenty Fourteen 1.0 */ if ( ! isset( $content_width ) ) { $content_width = 474; } /** * Twenty Fourteen only works in WordPress 3.6 or later. */ if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) { require get_template_directory() . '/inc/back-compat.php'; } if ( ! function_exists( 'twentyfourteen_setup' ) ) : /* function twentyfourteen_setup() – Twenty Fourteen setup. */ endif; // twentyfourteen_setup() add_action( 'after_setup_theme', 'twentyfourteen_setup' ); /* function twentyfourteen_content_width() – Adjust content_width value for image attachment template. */ add_action( 'template_redirect', 'twentyfourteen_content_width' ); /* function twentyfourteen_get_featured_posts() – Getter function for Featured Content Plugin. */ /* function twentyfourteen_has_featured_posts() – A helper conditional function that returns a boolean value. */ /* function twentyfourteen_widgets_init() – Register three Twenty Fourteen widget areas. */ add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); /* function twentyfourteen_font_url() – Register Lato Google font for Twenty Fourteen. */ /* function twentyfourteen_scripts() – Enqueue scripts and styles for the front end. */ add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); /* function twentyfourteen_admin_fonts() – Enqueue Google fonts style to admin screen for custom header display. */ add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); /* function twentyfourteen_resource_hints() – Add preconnect for Google Fonts. */ add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); /* function twentyfourteen_block_editor_styles() – Enqueue styles for the block-based editor. */ add_action( 'enqueue_block_editor_assets', 'twentyfourteen_block_editor_styles' ); if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : /* function twentyfourteen_the_attached_image() – Print the attached image with a link to the next attached image. */ endif; if ( ! function_exists( 'twentyfourteen_list_authors' ) ) : /* function twentyfourteen_list_authors() – Print a list of all site contributors who published at least one post. */ endif; /* function twentyfourteen_body_classes() – Extend the default WordPress body classes. */ add_filter( 'body_class', 'twentyfourteen_body_classes' ); /* function twentyfourteen_post_classes() – Extend the default WordPress post classes. */ add_filter( 'post_class', 'twentyfourteen_post_classes' ); /* function twentyfourteen_wp_title() – Create a nicely formatted and more specific title element text for output in head of document, based on current view. */ add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); /* function twentyfourteen_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', 'twentyfourteen_widget_tag_cloud_args' );