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 21:28:18 +02:00
< ? php
/**
2014-11-19 21:28:25 +01: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 21:28:18 +02: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 .
*
2014-11-19 21:28:25 +01:00
* @ link https :// codex . wordpress . org / Theme_Development
* @ link https :// codex . wordpress . org / 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 21:28:18 +02: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 ,
2014-11-19 21:28:25 +01:00
* { @ link https :// codex . wordpress . org / Plugin_API }
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 21:28:18 +02: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 23:14:22 +01:00
/**
* Twenty Fifteen only works in WordPress 4.1 or later .
*/
2014-10-30 12:57:22 +01:00
if ( version_compare ( $GLOBALS [ 'wp_version' ], '4.1-alpha' , '<' ) ) {
require get_template_directory () . '/inc/back-compat.php' ;
}
2014-10-29 23:14:22 +01: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 21:28:18 +02:00
if ( ! function_exists ( 'twentyfifteen_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features .
*
* 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 .
*
* @ since Twenty Fifteen 1.0
*/
function twentyfifteen_setup () {
/*
* Make theme available for translation .
* Translations can be filed in the / languages / directory .
* If you ' re building a theme based on twentyfifteen , use a find and replace
* to change 'twentyfifteen' to the name of your theme in all the template files
*/
load_theme_textdomain ( 'twentyfifteen' , get_template_directory () . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support ( 'automatic-feed-links' );
2014-10-29 22:56:23 +01:00
/*
* 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' );
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 21:28:18 +02:00
/*
* Enable support for Post Thumbnails on posts and pages .
*
2014-11-19 21:28:25 +01:00
* See : https :// codex . wordpress . org / Function_Reference / add_theme_support #Post_Thumbnails
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 21:28:18 +02:00
*/
add_theme_support ( 'post-thumbnails' );
set_post_thumbnail_size ( 825 , 510 , true );
2014-11-25 21:38:25 +01:00
// This theme uses wp_nav_menu() in two locations.
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 21:28:18 +02:00
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 ( 'html5' , array (
'search-form' , 'comment-form' , 'comment-list' , 'gallery' , 'caption'
) );
/*
* Enable support for Post Formats .
2014-11-19 21:28:25 +01:00
*
* See : https :// codex . wordpress . org / Post_Formats
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 21:28:18 +02:00
*/
add_theme_support ( 'post-formats' , array (
'aside' , 'image' , 'video' , 'quote' , 'link' , 'gallery' , 'status' , 'audio' , 'chat'
) );
$color_scheme = twentyfifteen_get_color_scheme ();
$default_color = trim ( $color_scheme [ 0 ], '#' );
// Setup the WordPress core custom background feature.
add_theme_support ( 'custom-background' , apply_filters ( 'twentyfifteen_custom_background_args' , array (
'default-color' => $default_color ,
'default-attachment' => 'fixed' ,
) ) );
/*
* This theme styles the visual editor to resemble the theme style ,
* specifically font , colors , icons , and column width .
*/
add_editor_style ( array ( 'css/editor-style.css' , 'genericons/genericons.css' , twentyfifteen_fonts_url () ) );
}
endif ; // twentyfifteen_setup
add_action ( 'after_setup_theme' , 'twentyfifteen_setup' );
/**
* Register widget area .
*
* @ since Twenty Fifteen 1.0
*
2014-11-19 21:28:25 +01:00
* @ link https :// codex . wordpress . org / Function_Reference / 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 21:28:18 +02:00
*/
function twentyfifteen_widgets_init () {
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>' ,
2014-10-28 22:03:22 +01:00
'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 21:28:18 +02:00
) );
}
add_action ( 'widgets_init' , 'twentyfifteen_widgets_init' );
if ( ! function_exists ( 'twentyfifteen_fonts_url' ) ) :
/**
* Register Google fonts for Twenty Fifteen .
*
* @ since Twenty Fifteen 1.0
*
2014-11-25 21:57:24 +01:00
* @ return string Google fonts URL for the theme .
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 21:28:18 +02:00
*/
function twentyfifteen_fonts_url () {
2014-12-12 19:26:24 +01:00
$fonts_url = '' ;
$fonts = array ();
$subsets = 'latin,latin-ext' ;
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 21:28:18 +02:00
2014-12-08 19:25:22 +01:00
/* translators: If there are characters in your language that are not supported by Noto Sans, translate this to 'off'. Do not translate into your own language. */
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 21:28:18 +02:00
if ( 'off' !== _x ( 'on' , 'Noto Sans font: on or off' , 'twentyfifteen' ) ) {
$fonts [] = 'Noto Sans:400italic,700italic,400,700' ;
}
2014-12-08 19:25:22 +01:00
/* translators: If there are characters in your language that are not supported by Noto Serif, translate this to 'off'. Do not translate into your own language. */
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 21:28:18 +02:00
if ( 'off' !== _x ( 'on' , 'Noto Serif font: on or off' , 'twentyfifteen' ) ) {
$fonts [] = 'Noto Serif:400italic,700italic,400,700' ;
}
2014-12-08 19:25:22 +01:00
/* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */
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 21:28:18 +02:00
if ( 'off' !== _x ( 'on' , 'Inconsolata font: on or off' , 'twentyfifteen' ) ) {
$fonts [] = 'Inconsolata:400,700' ;
}
2014-12-08 19:25:22 +01:00
/* translators: To add an additional character subset specific to your language, translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. */
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 21:28:18 +02:00
$subset = _x ( 'no-subset' , 'Add new subset (greek, cyrillic, devanagari, vietnamese)' , 'twentyfifteen' );
if ( 'cyrillic' == $subset ) {
$subsets .= ',cyrillic,cyrillic-ext' ;
} elseif ( 'greek' == $subset ) {
$subsets .= ',greek,greek-ext' ;
} elseif ( 'devanagari' == $subset ) {
$subsets .= ',devanagari' ;
} elseif ( 'vietnamese' == $subset ) {
$subsets .= ',vietnamese' ;
}
2014-12-12 19:26:24 +01:00
if ( $fonts ) {
$fonts_url = add_query_arg ( array (
'family' => urlencode ( implode ( '|' , $fonts ) ),
'subset' => urlencode ( $subsets ),
), '//fonts.googleapis.com/css' );
}
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 21:28:18 +02:00
}
endif ;
/**
* Enqueue scripts and styles .
*
* @ since Twenty Fifteen 1.0
*/
function twentyfifteen_scripts () {
// Add custom fonts, used in the main stylesheet.
wp_enqueue_style ( 'twentyfifteen-fonts' , twentyfifteen_fonts_url (), array (), null );
// Add Genericons, used in the main stylesheet.
wp_enqueue_style ( 'genericons' , get_template_directory_uri () . '/genericons/genericons.css' , array (), '3.2' );
// Load our main stylesheet.
2014-12-15 18:38:26 +01:00
wp_enqueue_style ( 'twentyfifteen-style' , get_stylesheet_uri () );
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 21:28:18 +02:00
// Load the Internet Explorer specific stylesheet.
2014-12-01 20:41:22 +01:00
wp_enqueue_style ( 'twentyfifteen-ie' , get_template_directory_uri () . '/css/ie.css' , array ( 'twentyfifteen-style' ), '20141010' );
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 21:28:18 +02:00
wp_style_add_data ( 'twentyfifteen-ie' , 'conditional' , 'lt IE 9' );
// Load the Internet Explorer 7 specific stylesheet.
wp_enqueue_style ( 'twentyfifteen-ie7' , get_template_directory_uri () . '/css/ie7.css' , array ( 'twentyfifteen-style' ), '20141010' );
wp_style_add_data ( 'twentyfifteen-ie7' , 'conditional' , 'lt IE 8' );
wp_enqueue_script ( 'twentyfifteen-skip-link-focus-fix' , get_template_directory_uri () . '/js/skip-link-focus-fix.js' , array (), '20141010' , 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 ( 'twentyfifteen-keyboard-image-navigation' , get_template_directory_uri () . '/js/keyboard-image-navigation.js' , array ( 'jquery' ), '20141010' );
}
2014-12-13 00:59:22 +01:00
wp_enqueue_script ( 'twentyfifteen-script' , get_template_directory_uri () . '/js/functions.js' , array ( 'jquery' ), '20141212' , 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 21:28:18 +02:00
wp_localize_script ( 'twentyfifteen-script' , 'screenReaderText' , array (
2014-10-24 17:15:20 +02:00
'expand' => '<span class="screen-reader-text">' . esc_html__ ( 'expand child menu' , 'twentyfifteen' ) . '</span>' ,
'collapse' => '<span class="screen-reader-text">' . esc_html__ ( '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 21:28:18 +02:00
) );
}
add_action ( 'wp_enqueue_scripts' , 'twentyfifteen_scripts' );
/**
2014-11-04 21:26:23 +01: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 21:28:18 +02:00
*
* @ since Twenty Fifteen 1.0
2014-11-25 21:57:24 +01: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 21:28:18 +02: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 = '' ;
if ( is_attachment () && 'attachment' == $previous -> post_type ) {
return ;
}
if ( $previous && has_post_thumbnail ( $previous -> ID ) ) {
$prevthumb = wp_get_attachment_image_src ( get_post_thumbnail_id ( $previous -> ID ), 'post-thumbnail' );
2014-11-03 22:40:23 +01:00
$css .= '
. post - navigation . nav - previous { background - image : url ( ' . esc_url( $prevthumb[0] ) . ' ); }
2014-11-27 21:34:24 +01: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 22:40:23 +01: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 21:28:18 +02:00
}
if ( $next && has_post_thumbnail ( $next -> ID ) ) {
$nextthumb = wp_get_attachment_image_src ( get_post_thumbnail_id ( $next -> ID ), 'post-thumbnail' );
2014-11-03 22:40:23 +01:00
$css .= '
. post - navigation . nav - next { background - image : url ( ' . esc_url( $nextthumb[0] ) . ' ); }
2014-11-27 21:34:24 +01: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 22:40:23 +01: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 21:28:18 +02: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
*
* @ param string $item_output The menu item output .
* @ param WP_Post $item Menu item object .
* @ param int $depth Depth of the menu .
* @ param array $args wp_nav_menu () arguments .
* @ return string Menu item with possible description .
*/
function twentyfifteen_nav_description ( $item_output , $item , $depth , $args ) {
if ( 'primary' == $args -> theme_location && $item -> description ) {
2014-11-11 20:02:22 +01: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 21:28:18 +02:00
}
return $item_output ;
}
add_filter ( 'walker_nav_menu_start_el' , 'twentyfifteen_nav_description' , 10 , 4 );
2014-10-28 19:14:18 +01:00
/**
2014-11-04 21:26:23 +01:00
* Add a `screen-reader-text` class to the search form ' s submit button .
2014-10-28 19:14:18 +01:00
*
* @ since Twenty Fifteen 1.0
*
2014-11-25 21:57:24 +01:00
* @ param string $html Search form HTML .
* @ return string Modified search form HTML .
2014-10-28 19:14:18 +01: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' );
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 21:28:18 +02: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' ;