X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..607b7e02d77e7326161e8ec15639052d2040f745:/wp-content/themes/twentysixteen/functions.php?ds=sidebyside diff --git a/wp-content/themes/twentysixteen/functions.php b/wp-content/themes/twentysixteen/functions.php index 1371e2b1..3626af96 100644 --- a/wp-content/themes/twentysixteen/functions.php +++ b/wp-content/themes/twentysixteen/functions.php @@ -47,11 +47,11 @@ if ( ! function_exists( 'twentysixteen_setup' ) ) : function twentysixteen_setup() { /* * Make theme available for translation. - * Translations can be filed in the /languages/ directory. + * Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentysixteen * If you're building a theme based on Twenty Sixteen, use a find and replace * to change 'twentysixteen' to the name of your theme in all the template files */ - load_theme_textdomain( 'twentysixteen', get_template_directory() . '/languages' ); + load_theme_textdomain( 'twentysixteen' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); @@ -64,13 +64,24 @@ function twentysixteen_setup() { */ add_theme_support( 'title-tag' ); + /* + * Enable support for custom logo. + * + * @since Twenty Sixteen 1.2 + */ + add_theme_support( 'custom-logo', array( + 'height' => 240, + 'width' => 240, + 'flex-height' => true, + ) ); + /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); - set_post_thumbnail_size( 1200, 0, true ); + set_post_thumbnail_size( 1200, 9999 ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( @@ -112,6 +123,9 @@ function twentysixteen_setup() { * specifically font, colors, icons, and column width. */ add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); + + // Indicate widget sidebars can use selective refresh in the Customizer. + add_theme_support( 'customize-selective-refresh-widgets' ); } endif; // twentysixteen_setup add_action( 'after_setup_theme', 'twentysixteen_setup' ); @@ -239,32 +253,32 @@ function twentysixteen_scripts() { wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() ); // Load the Internet Explorer specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20150825' ); + wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20160816' ); wp_style_add_data( 'twentysixteen-ie', 'conditional', 'lt IE 10' ); // Load the Internet Explorer 8 specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20150825' ); + wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20160816' ); wp_style_add_data( 'twentysixteen-ie8', 'conditional', 'lt IE 9' ); // Load the Internet Explorer 7 specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20150825' ); + wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20160816' ); wp_style_add_data( 'twentysixteen-ie7', 'conditional', 'lt IE 8' ); // Load the html5 shiv. wp_enqueue_script( 'twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' ); wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); - wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20150825', true ); + wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20160816', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { - wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20150825' ); + wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' ); } - wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150825', true ); + wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160816', true ); wp_localize_script( 'twentysixteen-script', 'screenReaderText', array( 'expand' => __( 'expand child menu', 'twentysixteen' ), @@ -389,3 +403,19 @@ function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { return $attr; } add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10 , 3 ); + +/** + * Modifies tag cloud widget arguments to have all tags in the widget same font size. + * + * @since Twenty Sixteen 1.1 + * + * @param array $args Arguments for tag cloud widget. + * @return array A new modified arguments. + */ +function twentysixteen_widget_tag_cloud_args( $args ) { + $args['largest'] = 1; + $args['smallest'] = 1; + $args['unit'] = 'em'; + return $args; +} +add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' );