Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
<?php
|
|
|
|
/**
|
2014-11-19 15:28:25 -05:00
|
|
|
* Twenty Fifteen functions and definitions
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2019-07-25 18:46:55 -04:00
|
|
|
* @link https://developer.wordpress.org/themes/basics/theme-functions/
|
2019-04-01 07:56:52 -04:00
|
|
|
* @link https://developer.wordpress.org/themes/advanced-topics/child-themes/
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*
|
|
|
|
* 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,
|
2019-07-25 18:46:55 -04:00
|
|
|
* {@link https://developer.wordpress.org/plugins/}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*
|
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
|
2014-10-29 18:14:22 -04:00
|
|
|
/**
|
|
|
|
* Twenty Fifteen only works in WordPress 4.1 or later.
|
|
|
|
*/
|
2014-10-30 07:57:22 -04:00
|
|
|
if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) {
|
|
|
|
require get_template_directory() . '/inc/back-compat.php';
|
|
|
|
}
|
2014-10-29 18:14:22 -04:00
|
|
|
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
if ( ! function_exists( 'twentyfifteen_setup' ) ) :
|
2016-10-20 16:34:31 -04:00
|
|
|
/**
|
2017-11-30 18:11:00 -05:00
|
|
|
* Sets up theme defaults and registers support for various WordPress features.
|
2016-10-20 16:34:31 -04:00
|
|
|
*
|
2017-11-30 18:11:00 -05:00
|
|
|
* Note that this function is hooked into the after_setup_theme hook, which
|
|
|
|
* runs before the init hook. The init hook is too late for some features, such
|
|
|
|
* as indicating support for post thumbnails.
|
2016-10-20 16:34:31 -04:00
|
|
|
*
|
2017-11-30 18:11:00 -05:00
|
|
|
* @since Twenty Fifteen 1.0
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*/
|
2017-11-30 18:11:00 -05:00
|
|
|
function twentyfifteen_setup() {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Make theme available for translation.
|
|
|
|
* Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen
|
|
|
|
* If you're building a theme based on twentyfifteen, use a find and replace
|
2023-06-16 09:04:21 -04:00
|
|
|
* to change 'twentyfifteen' to the name of your theme in all the template files.
|
|
|
|
*
|
|
|
|
* Manual loading of text domain is not required after the introduction of
|
|
|
|
* just in time translation loading in WordPress version 4.6.
|
|
|
|
*
|
|
|
|
* @ticket 58318
|
2017-11-30 18:11:00 -05:00
|
|
|
*/
|
2023-06-16 09:04:21 -04:00
|
|
|
|
|
|
|
if ( version_compare( $GLOBALS['wp_version'], '4.6', '<' ) ) {
|
|
|
|
load_theme_textdomain( 'twentyfifteen' );
|
|
|
|
}
|
2017-11-30 18:11:00 -05:00
|
|
|
|
|
|
|
// Add default posts and comments RSS feed links to head.
|
|
|
|
add_theme_support( 'automatic-feed-links' );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Let WordPress manage the document title.
|
|
|
|
* By adding theme support, we declare that this theme does not use a
|
|
|
|
* hard-coded <title> tag in the document head, and expect WordPress to
|
|
|
|
* provide it for us.
|
|
|
|
*/
|
|
|
|
add_theme_support( 'title-tag' );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable support for Post Thumbnails on posts and pages.
|
|
|
|
*
|
2019-04-07 01:23:51 -04:00
|
|
|
* See: https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails
|
2017-11-30 18:11:00 -05:00
|
|
|
*/
|
|
|
|
add_theme_support( 'post-thumbnails' );
|
|
|
|
set_post_thumbnail_size( 825, 510, true );
|
|
|
|
|
|
|
|
// This theme uses wp_nav_menu() in two locations.
|
|
|
|
register_nav_menus(
|
|
|
|
array(
|
|
|
|
'primary' => __( 'Primary Menu', 'twentyfifteen' ),
|
|
|
|
'social' => __( 'Social Links Menu', 'twentyfifteen' ),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Switch default core markup for search form, comment form, and comments
|
|
|
|
* to output valid HTML5.
|
|
|
|
*/
|
|
|
|
add_theme_support(
|
2018-08-16 21:51:36 -04:00
|
|
|
'html5',
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'search-form',
|
|
|
|
'comment-form',
|
|
|
|
'comment-list',
|
|
|
|
'gallery',
|
|
|
|
'caption',
|
2019-09-18 10:51:56 -04:00
|
|
|
'script',
|
|
|
|
'style',
|
2020-10-19 16:32:05 -04:00
|
|
|
'navigation-widgets',
|
2017-11-30 18:11:00 -05:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable support for Post Formats.
|
|
|
|
*
|
2024-03-11 10:00:12 -04:00
|
|
|
* See: https://developer.wordpress.org/advanced-administration/wordpress/post-formats/
|
2017-11-30 18:11:00 -05:00
|
|
|
*/
|
|
|
|
add_theme_support(
|
2018-08-16 21:51:36 -04:00
|
|
|
'post-formats',
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'aside',
|
|
|
|
'image',
|
|
|
|
'video',
|
|
|
|
'quote',
|
|
|
|
'link',
|
|
|
|
'gallery',
|
|
|
|
'status',
|
|
|
|
'audio',
|
|
|
|
'chat',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable support for custom logo.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.5
|
|
|
|
*/
|
|
|
|
add_theme_support(
|
2018-08-16 21:51:36 -04:00
|
|
|
'custom-logo',
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'height' => 248,
|
|
|
|
'width' => 248,
|
|
|
|
'flex-height' => true,
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$color_scheme = twentyfifteen_get_color_scheme();
|
|
|
|
$default_color = trim( $color_scheme[0], '#' );
|
|
|
|
|
|
|
|
// Setup the WordPress core custom background feature.
|
|
|
|
|
|
|
|
add_theme_support(
|
2018-08-16 21:51:36 -04:00
|
|
|
'custom-background',
|
2020-07-01 09:52:01 -04:00
|
|
|
/**
|
2020-08-10 20:34:08 -04:00
|
|
|
* Filters Twenty Fifteen custom-background support arguments.
|
2020-07-01 09:52:01 -04:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @param array $args {
|
|
|
|
* An array of custom-background support arguments.
|
|
|
|
*
|
|
|
|
* @type string $default-color Default color of the background.
|
|
|
|
* @type string $default-attachment Default attachment of the background.
|
|
|
|
* }
|
|
|
|
*/
|
2018-08-16 21:51:36 -04:00
|
|
|
apply_filters(
|
|
|
|
'twentyfifteen_custom_background_args',
|
|
|
|
array(
|
2017-11-30 18:11:00 -05:00
|
|
|
'default-color' => $default_color,
|
|
|
|
'default-attachment' => 'fixed',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This theme styles the visual editor to resemble the theme style,
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
* specifically font, colors, icons, and column width. When fonts are
|
|
|
|
* self-hosted, the theme directory needs to be removed first.
|
2017-11-30 18:11:00 -05:00
|
|
|
*/
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$font_stylesheet = str_replace(
|
|
|
|
array( get_template_directory_uri() . '/', get_stylesheet_directory_uri() . '/' ),
|
|
|
|
'',
|
2024-02-12 16:48:08 -05:00
|
|
|
(string) twentyfifteen_fonts_url()
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
);
|
|
|
|
add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', $font_stylesheet ) );
|
2017-11-30 18:11:00 -05:00
|
|
|
|
2018-12-13 21:13:38 -05:00
|
|
|
// Load regular editor styles into the new block-based editor.
|
|
|
|
add_theme_support( 'editor-styles' );
|
|
|
|
|
|
|
|
// Load default block styles.
|
|
|
|
add_theme_support( 'wp-block-styles' );
|
|
|
|
|
2018-12-16 22:07:04 -05:00
|
|
|
// Add support for responsive embeds.
|
|
|
|
add_theme_support( 'responsive-embeds' );
|
|
|
|
|
2018-12-13 21:13:38 -05:00
|
|
|
// Add support for custom color scheme.
|
|
|
|
add_theme_support(
|
|
|
|
'editor-color-palette',
|
|
|
|
array(
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Gray', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-gray',
|
|
|
|
'color' => '#111',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Gray', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-gray',
|
|
|
|
'color' => '#f1f1f1',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'White', 'twentyfifteen' ),
|
|
|
|
'slug' => 'white',
|
|
|
|
'color' => '#fff',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Yellow', 'twentyfifteen' ),
|
|
|
|
'slug' => 'yellow',
|
|
|
|
'color' => '#f4ca16',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Brown', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-brown',
|
|
|
|
'color' => '#352712',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Medium Pink', 'twentyfifteen' ),
|
|
|
|
'slug' => 'medium-pink',
|
|
|
|
'color' => '#e53b51',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Pink', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-pink',
|
|
|
|
'color' => '#ffe5d1',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Purple', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-purple',
|
|
|
|
'color' => '#2e2256',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Purple', 'twentyfifteen' ),
|
|
|
|
'slug' => 'purple',
|
|
|
|
'color' => '#674970',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Blue Gray', 'twentyfifteen' ),
|
|
|
|
'slug' => 'blue-gray',
|
|
|
|
'color' => '#22313f',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Bright Blue', 'twentyfifteen' ),
|
|
|
|
'slug' => 'bright-blue',
|
|
|
|
'color' => '#55c3dc',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Blue', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-blue',
|
|
|
|
'color' => '#e9f2f9',
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2022-02-13 16:47:01 -05:00
|
|
|
// Add support for custom color scheme.
|
|
|
|
add_theme_support(
|
|
|
|
'editor-gradient-presets',
|
|
|
|
array(
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Gray Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-gray-gradient-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(17,17,17,1) 0%, rgba(42,42,42,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Gray Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-gray-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(241,241,241,1) 0%, rgba(215,215,215,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'White Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'white-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Yellow Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'yellow-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(244,202,22,1) 0%, rgba(205,168,10,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Brown Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-brown-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(53,39,18,1) 0%, rgba(91,67,31,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Medium Pink Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'medium-pink-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(229,59,81,1) 0%, rgba(209,28,51,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Pink Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-pink-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(255,229,209,1) 0%, rgba(255,200,158,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Dark Purple Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'dark-purple-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(46,34,86,1) 0%, rgba(66,48,123,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Purple Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'purple-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(103,73,112,1) 0%, rgba(131,93,143,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Blue Gray Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'blue-gray-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(34,49,63,1) 0%, rgba(52,75,96,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Bright Blue Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'bright-blue-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(85,195,220,1) 0%, rgba(43,180,211,1) 100%)',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'name' => __( 'Light Blue Gradient', 'twentyfifteen' ),
|
|
|
|
'slug' => 'light-blue-gradient',
|
|
|
|
'gradient' => 'linear-gradient(90deg, rgba(233,242,249,1) 0%, rgba(193,218,238,1) 100%)',
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
// Indicate widget sidebars can use selective refresh in the Customizer.
|
|
|
|
add_theme_support( 'customize-selective-refresh-widgets' );
|
|
|
|
}
|
2020-01-28 19:45:18 -05:00
|
|
|
endif; // twentyfifteen_setup()
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
add_action( 'after_setup_theme', 'twentyfifteen_setup' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register widget area.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
2019-07-25 18:46:55 -04:00
|
|
|
* @link https://developer.wordpress.org/reference/functions/register_sidebar/
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*/
|
|
|
|
function twentyfifteen_widgets_init() {
|
2017-11-30 18:11:00 -05:00
|
|
|
register_sidebar(
|
|
|
|
array(
|
|
|
|
'name' => __( 'Widget Area', 'twentyfifteen' ),
|
|
|
|
'id' => 'sidebar-1',
|
|
|
|
'description' => __( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ),
|
|
|
|
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
|
|
|
'after_widget' => '</aside>',
|
|
|
|
'before_title' => '<h2 class="widget-title">',
|
|
|
|
'after_title' => '</h2>',
|
|
|
|
)
|
|
|
|
);
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
add_action( 'widgets_init', 'twentyfifteen_widgets_init' );
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) :
|
2017-11-30 18:11:00 -05:00
|
|
|
/**
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
* Register fonts for Twenty Fifteen.
|
2017-11-30 18:11:00 -05:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
* @since Twenty Fifteen 3.4 Replaced Google URL with self-hosted fonts.
|
2017-11-30 18:11:00 -05:00
|
|
|
*
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
* @return string Fonts URL for the theme.
|
2015-02-22 08:43:24 -05:00
|
|
|
*/
|
2017-11-30 18:11:00 -05:00
|
|
|
function twentyfifteen_fonts_url() {
|
|
|
|
$fonts_url = '';
|
|
|
|
$fonts = array();
|
|
|
|
|
|
|
|
/*
|
2019-09-02 20:41:05 -04:00
|
|
|
* translators: If there are characters in your language that are not supported
|
2017-11-30 18:11:00 -05:00
|
|
|
* by Noto Sans, translate this to 'off'. Do not translate into your own language.
|
|
|
|
*/
|
|
|
|
if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) {
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$fonts[] = 'noto-sans';
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
/*
|
2019-09-02 20:41:05 -04:00
|
|
|
* translators: If there are characters in your language that are not supported
|
2017-11-30 18:11:00 -05:00
|
|
|
* by Noto Serif, translate this to 'off'. Do not translate into your own language.
|
|
|
|
*/
|
|
|
|
if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) {
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$fonts[] = 'noto-serif';
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
/*
|
2019-09-02 20:41:05 -04:00
|
|
|
* translators: If there are characters in your language that are not supported
|
2017-11-30 18:11:00 -05:00
|
|
|
* by Inconsolata, translate this to 'off'. Do not translate into your own language.
|
|
|
|
*/
|
|
|
|
if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) {
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$fonts[] = 'inconsolata';
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( $fonts ) {
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$fonts_url = get_template_directory_uri() . '/assets/fonts/' . implode( '-plus-', $fonts ) . '.css';
|
2017-11-30 18:11:00 -05:00
|
|
|
}
|
2014-12-12 13:26:24 -05:00
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
return $fonts_url;
|
|
|
|
}
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
endif;
|
|
|
|
|
2015-01-15 18:10:22 -05:00
|
|
|
/**
|
|
|
|
* JavaScript Detection.
|
|
|
|
*
|
|
|
|
* Adds a `js` class to the root `<html>` element when JavaScript is detected.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.1
|
|
|
|
*/
|
|
|
|
function twentyfifteen_javascript_detection() {
|
|
|
|
echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
|
|
|
|
}
|
|
|
|
add_action( 'wp_head', 'twentyfifteen_javascript_detection', 0 );
|
|
|
|
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
/**
|
|
|
|
* Enqueue scripts and styles.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
function twentyfifteen_scripts() {
|
|
|
|
// Add custom fonts, used in the main stylesheet.
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$font_version = ( 0 === strpos( (string) twentyfifteen_fonts_url(), get_template_directory_uri() . '/' ) ) ? '20230328' : null;
|
|
|
|
wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), $font_version );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
// Add Genericons, used in the main stylesheet.
|
2022-10-11 13:05:13 -04:00
|
|
|
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '20201026' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
// Load our main stylesheet.
|
2023-11-06 10:21:23 -05:00
|
|
|
wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri(), array(), '20231107' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
2018-12-13 21:13:38 -05:00
|
|
|
// Theme block stylesheet.
|
2023-07-26 18:09:22 -04:00
|
|
|
wp_enqueue_style( 'twentyfifteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentyfifteen-style' ), '20230623' );
|
2018-12-13 21:13:38 -05:00
|
|
|
|
Twenty Fifteen: Remove IE specific resources.
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.
It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), removes IE-specific code in general stylesheets, and removes IE specific code
from Customizer, header.php and custom-header.php.
Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@55981
git-svn-id: http://core.svn.wordpress.org/trunk@55493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 02:11:26 -04:00
|
|
|
// Register the Internet Explorer specific stylesheet.
|
|
|
|
wp_register_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20220908' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
wp_style_add_data( 'twentyfifteen-ie', 'conditional', 'lt IE 9' );
|
|
|
|
|
Twenty Fifteen: Remove IE specific resources.
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.
It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), removes IE-specific code in general stylesheets, and removes IE specific code
from Customizer, header.php and custom-header.php.
Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.
Built from https://develop.svn.wordpress.org/trunk@55981
git-svn-id: http://core.svn.wordpress.org/trunk@55493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 02:11:26 -04:00
|
|
|
// Register the Internet Explorer 7 specific stylesheet.
|
|
|
|
wp_register_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141210' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' );
|
|
|
|
|
2023-05-26 13:25:23 -04:00
|
|
|
// Skip-link fix is no longer enqueued by default.
|
2023-09-06 17:23:20 -04:00
|
|
|
wp_register_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20230526', array( 'in_footer' => true ) );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
|
|
|
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
|
|
|
wp_enqueue_script( 'comment-reply' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( is_singular() && wp_attachment_is_image() ) {
|
2019-08-07 21:29:58 -04:00
|
|
|
wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141210' );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
2023-09-11 20:06:19 -04:00
|
|
|
wp_enqueue_script(
|
|
|
|
'twentyfifteen-script',
|
|
|
|
get_template_directory_uri() . '/js/functions.js',
|
|
|
|
array( 'jquery' ),
|
|
|
|
'20221101',
|
|
|
|
array(
|
|
|
|
'in_footer' => false, // Because involves header.
|
|
|
|
'strategy' => 'defer',
|
|
|
|
)
|
|
|
|
);
|
2017-11-30 18:11:00 -05:00
|
|
|
wp_localize_script(
|
2018-08-16 21:51:36 -04:00
|
|
|
'twentyfifteen-script',
|
|
|
|
'screenReaderText',
|
|
|
|
array(
|
I18N: Mark screen reader strings as such with translator comments.
This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.
Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.
Built from https://develop.svn.wordpress.org/trunk@55276
git-svn-id: http://core.svn.wordpress.org/trunk@54809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 12:10:21 -05:00
|
|
|
/* translators: Hidden accessibility text. */
|
2017-11-30 18:11:00 -05:00
|
|
|
'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',
|
I18N: Mark screen reader strings as such with translator comments.
This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.
Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.
Built from https://develop.svn.wordpress.org/trunk@55276
git-svn-id: http://core.svn.wordpress.org/trunk@54809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 12:10:21 -05:00
|
|
|
/* translators: Hidden accessibility text. */
|
2017-11-30 18:11:00 -05:00
|
|
|
'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>',
|
|
|
|
)
|
|
|
|
);
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' );
|
|
|
|
|
2018-12-13 21:13:38 -05:00
|
|
|
/**
|
2018-12-18 22:30:41 -05:00
|
|
|
* Enqueue styles for the block-based editor.
|
2018-12-13 21:13:38 -05:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 2.1
|
|
|
|
*/
|
|
|
|
function twentyfifteen_block_editor_styles() {
|
|
|
|
// Block styles.
|
2023-07-26 18:09:22 -04:00
|
|
|
wp_enqueue_style( 'twentyfifteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20230623' );
|
2018-12-13 21:13:38 -05:00
|
|
|
// Add custom fonts.
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
$font_version = ( 0 === strpos( (string) twentyfifteen_fonts_url(), get_template_directory_uri() . '/' ) ) ? '20230328' : null;
|
|
|
|
wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), $font_version );
|
2018-12-13 21:13:38 -05:00
|
|
|
}
|
|
|
|
add_action( 'enqueue_block_editor_assets', 'twentyfifteen_block_editor_styles' );
|
|
|
|
|
|
|
|
|
2016-10-22 21:56:32 -04:00
|
|
|
/**
|
|
|
|
* Add preconnect for Google Fonts.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.7
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
* @deprecated Twenty Fifteen 3.4 Disabled filter because, by default, fonts are self-hosted.
|
2016-10-22 21:56:32 -04:00
|
|
|
*
|
|
|
|
* @param array $urls URLs to print for resource hints.
|
|
|
|
* @param string $relation_type The relation type the URLs are printed.
|
|
|
|
* @return array URLs to print for resource hints.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_resource_hints( $urls, $relation_type ) {
|
|
|
|
if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) {
|
|
|
|
if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) {
|
|
|
|
$urls[] = array(
|
|
|
|
'href' => 'https://fonts.gstatic.com',
|
|
|
|
'crossorigin',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$urls[] = 'https://fonts.gstatic.com';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $urls;
|
|
|
|
}
|
Twenty Fifteen: Bundle Google Fonts locally.
This changeset bundles the Google Fonts used by Twenty Fifteen locally in the theme folder, instead of loading them from Google servers. Existing font stylesheet handles are maintained for backward compatibilily.
Props garrett-eclipse, kjellr, ocean90, SergeyBiryukov, westonruter, luminuu, audrasjb, jhoffmann, jffng, paapst, cbirdsong, webcommsat, kau-boy, MatthiasReinholz, sabernhardt, hellofromTonya, JeffPaul, davidbaumwald, desrosj, bedas, poena, costdev, mukesh27, azaozz, aristath.
See #55985.
Built from https://develop.svn.wordpress.org/trunk@55268
git-svn-id: http://core.svn.wordpress.org/trunk@54801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 10:52:26 -05:00
|
|
|
// add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 );
|
2016-10-22 21:56:32 -04:00
|
|
|
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
/**
|
2014-11-04 15:26:23 -05:00
|
|
|
* Add featured image as background image to post navigation elements.
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
2014-11-25 15:57:24 -05:00
|
|
|
*
|
|
|
|
* @see wp_add_inline_style()
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
*/
|
|
|
|
function twentyfifteen_post_nav_background() {
|
|
|
|
if ( ! is_single() ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
|
|
|
|
$next = get_adjacent_post( false, '', false );
|
|
|
|
$css = '';
|
|
|
|
|
2020-05-16 14:42:12 -04:00
|
|
|
if ( is_attachment() && 'attachment' === $previous->post_type ) {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-11-30 18:11:00 -05:00
|
|
|
if ( $previous && has_post_thumbnail( $previous->ID ) ) {
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
$prevthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $previous->ID ), 'post-thumbnail' );
|
2017-11-30 18:11:00 -05:00
|
|
|
$css .= '
|
2014-11-03 16:40:23 -05:00
|
|
|
.post-navigation .nav-previous { background-image: url(' . esc_url( $prevthumb[0] ) . '); }
|
2014-11-27 15:34:24 -05:00
|
|
|
.post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; }
|
2014-11-03 16:40:23 -05:00
|
|
|
.post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
|
|
|
|
';
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( $next && has_post_thumbnail( $next->ID ) ) {
|
|
|
|
$nextthumb = wp_get_attachment_image_src( get_post_thumbnail_id( $next->ID ), 'post-thumbnail' );
|
2017-11-30 18:11:00 -05:00
|
|
|
$css .= '
|
2015-01-15 18:03:26 -05:00
|
|
|
.post-navigation .nav-next { background-image: url(' . esc_url( $nextthumb[0] ) . '); border-top: 0; }
|
2014-11-27 15:34:24 -05:00
|
|
|
.post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; }
|
2014-11-03 16:40:23 -05:00
|
|
|
.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
|
|
|
|
';
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
wp_add_inline_style( 'twentyfifteen-style', $css );
|
|
|
|
}
|
|
|
|
add_action( 'wp_enqueue_scripts', 'twentyfifteen_post_nav_background' );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display descriptions in main navigation.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
2020-06-20 07:22:10 -04:00
|
|
|
* @param string $item_output The menu item's starting HTML output.
|
|
|
|
* @param WP_Post $item Menu item data object.
|
|
|
|
* @param int $depth Depth of the menu. Used for padding.
|
|
|
|
* @param stdClass $args An object of wp_nav_menu() arguments.
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
* @return string Menu item with possible description.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) {
|
2020-05-16 14:42:12 -04:00
|
|
|
if ( 'primary' === $args->theme_location && $item->description ) {
|
2014-11-11 14:02:22 -05:00
|
|
|
$item_output = str_replace( $args->link_after . '</a>', '<div class="menu-item-description">' . $item->description . '</div>' . $args->link_after . '</a>', $item_output );
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return $item_output;
|
|
|
|
}
|
|
|
|
add_filter( 'walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4 );
|
|
|
|
|
2014-10-28 14:14:18 -04:00
|
|
|
/**
|
2014-11-04 15:26:23 -05:00
|
|
|
* Add a `screen-reader-text` class to the search form's submit button.
|
2014-10-28 14:14:18 -04:00
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
2014-11-25 15:57:24 -05:00
|
|
|
* @param string $html Search form HTML.
|
|
|
|
* @return string Modified search form HTML.
|
2014-10-28 14:14:18 -04:00
|
|
|
*/
|
|
|
|
function twentyfifteen_search_form_modify( $html ) {
|
|
|
|
return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
|
|
|
|
}
|
|
|
|
add_filter( 'get_search_form', 'twentyfifteen_search_form_modify' );
|
|
|
|
|
2017-10-04 19:53:47 -04:00
|
|
|
/**
|
|
|
|
* Modifies tag cloud widget arguments to display all tags in the same font size
|
|
|
|
* and use list format for better accessibility.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.9
|
|
|
|
*
|
|
|
|
* @param array $args Arguments for tag cloud widget.
|
|
|
|
* @return array The filtered arguments for tag cloud widget.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_widget_tag_cloud_args( $args ) {
|
|
|
|
$args['largest'] = 22;
|
|
|
|
$args['smallest'] = 8;
|
|
|
|
$args['unit'] = 'pt';
|
|
|
|
$args['format'] = 'list';
|
|
|
|
|
|
|
|
return $args;
|
|
|
|
}
|
|
|
|
add_filter( 'widget_tag_cloud_args', 'twentyfifteen_widget_tag_cloud_args' );
|
|
|
|
|
2019-08-01 22:33:57 -04:00
|
|
|
/**
|
|
|
|
* Prevents `author-bio.php` partial template from interfering with rendering
|
|
|
|
* an author archive of a user with the `bio` username.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 2.6
|
|
|
|
*
|
|
|
|
* @param string $template Template file.
|
|
|
|
* @return string Replacement template file.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_author_bio_template( $template ) {
|
|
|
|
if ( is_author() ) {
|
|
|
|
$author = get_queried_object();
|
|
|
|
if ( $author instanceof WP_User && 'bio' === $author->user_nicename ) {
|
2019-08-01 23:08:55 -04:00
|
|
|
// Use author templates if exist, fall back to template hierarchy otherwise.
|
|
|
|
return locate_template( array( "author-{$author->ID}.php", 'author.php' ) );
|
2019-08-01 22:33:57 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $template;
|
|
|
|
}
|
2019-08-01 23:08:55 -04:00
|
|
|
add_filter( 'author_template', 'twentyfifteen_author_bio_template' );
|
2019-08-01 22:33:57 -04:00
|
|
|
|
2017-10-04 19:53:47 -04:00
|
|
|
|
Importing Twenty Fifteen, first pass at our new default theme for 2015, set for 4.1.
It's good for posts, it's good for pages, it might be good for you. Development will occur in trunk. Have at it.
Props matt, iandstewart, iamtakashi, obenland, cainm, kristastevens, karmatosed, chellycat, lancewillett, kwight, davidakennedy. See #29799
Built from https://develop.svn.wordpress.org/trunk@29892
git-svn-id: http://core.svn.wordpress.org/trunk@29648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-14 15:28:18 -04:00
|
|
|
/**
|
|
|
|
* Implement the Custom Header feature.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
require get_template_directory() . '/inc/custom-header.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom template tags for this theme.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
require get_template_directory() . '/inc/template-tags.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Customizer additions.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
require get_template_directory() . '/inc/customizer.php';
|
2021-05-28 13:21:05 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Block Patterns.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 3.0
|
|
|
|
*/
|
|
|
|
require get_template_directory() . '/inc/block-patterns.php';
|