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-25 21:57:24 +01:00
|
|
|
* Custom template tags for Twenty Fifteen
|
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
|
|
|
*
|
|
|
|
* Eventually, some of the functionality here could be replaced by core features.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Fifteen
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_comment_nav' ) ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Display navigation to next/previous comments when applicable.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
function twentyfifteen_comment_nav() {
|
|
|
|
// Are there comments to navigate through?
|
|
|
|
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
|
|
|
|
?>
|
|
|
|
<nav class="navigation comment-navigation" role="navigation">
|
2014-12-16 14:00:22 +01:00
|
|
|
<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></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
|
|
|
<div class="nav-links">
|
|
|
|
<?php
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
|
|
|
|
printf( '<div class="nav-previous">%s</div>', $prev_link );
|
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;
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
|
|
|
|
printf( '<div class="nav-next">%s</div>', $next_link );
|
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;
|
|
|
|
?>
|
2017-12-01 00:11:00 +01:00
|
|
|
</div><!-- .nav-links -->
|
|
|
|
</nav><!-- .comment-navigation -->
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
}
|
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;
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Prints HTML with meta information for the categories, tags.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
function twentyfifteen_entry_meta() {
|
|
|
|
if ( is_sticky() && is_home() && ! is_paged() ) {
|
|
|
|
printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) );
|
|
|
|
}
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
$format = get_post_format();
|
|
|
|
if ( current_theme_supports( 'post-formats', $format ) ) {
|
|
|
|
printf(
|
|
|
|
'<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
|
|
|
|
sprintf( '<span class="screen-reader-text">%s </span>', _x( 'Format', 'Used before post format.', 'twentyfifteen' ) ),
|
|
|
|
esc_url( get_post_format_link( $format ) ),
|
|
|
|
get_post_format_string( $format )
|
|
|
|
);
|
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
|
|
|
}
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) {
|
|
|
|
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
|
|
|
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
|
|
|
}
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
$time_string = sprintf(
|
|
|
|
$time_string,
|
|
|
|
esc_attr( get_the_date( 'c' ) ),
|
|
|
|
get_the_date(),
|
|
|
|
esc_attr( get_the_modified_date( 'c' ) ),
|
|
|
|
get_the_modified_date()
|
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
|
|
|
);
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
printf(
|
|
|
|
'<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>',
|
|
|
|
_x( 'Posted on', 'Used before publish date.', 'twentyfifteen' ),
|
|
|
|
esc_url( get_permalink() ),
|
|
|
|
$time_string
|
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
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( 'post' == get_post_type() ) {
|
|
|
|
if ( is_singular() || is_multi_author() ) {
|
|
|
|
printf(
|
|
|
|
'<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>',
|
|
|
|
_x( 'Author', 'Used before post author name.', 'twentyfifteen' ),
|
|
|
|
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
|
|
|
get_the_author()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) );
|
|
|
|
if ( $categories_list && twentyfifteen_categorized_blog() ) {
|
|
|
|
printf(
|
|
|
|
'<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
|
|
|
_x( 'Categories', 'Used before category names.', 'twentyfifteen' ),
|
|
|
|
$categories_list
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen' ) );
|
|
|
|
if ( $tags_list && ! is_wp_error( $tags_list ) ) {
|
|
|
|
printf(
|
|
|
|
'<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>',
|
|
|
|
_x( 'Tags', 'Used before tag names.', 'twentyfifteen' ),
|
|
|
|
$tags_list
|
|
|
|
);
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( is_attachment() && wp_attachment_is_image() ) {
|
|
|
|
// Retrieve attachment metadata.
|
|
|
|
$metadata = wp_get_attachment_metadata();
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
printf(
|
|
|
|
'<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s × %4$s</a></span>',
|
|
|
|
_x( 'Full size', 'Used before full size attachment link.', 'twentyfifteen' ),
|
|
|
|
esc_url( wp_get_attachment_url() ),
|
|
|
|
$metadata['width'],
|
|
|
|
$metadata['height']
|
|
|
|
);
|
|
|
|
}
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
|
|
|
|
echo '<span class="comments-link">';
|
|
|
|
/* translators: %s: post title */
|
|
|
|
comments_popup_link( sprintf( __( 'Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen' ), get_the_title() ) );
|
|
|
|
echo '</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
|
|
|
}
|
|
|
|
endif;
|
|
|
|
|
|
|
|
/**
|
2014-11-25 21:57:24 +01:00
|
|
|
* Determine whether blog/site has more than one category.
|
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
|
|
|
* @return bool True of there is more than one category, false otherwise.
|
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_categorized_blog() {
|
|
|
|
if ( false === ( $all_the_cool_cats = get_transient( 'twentyfifteen_categories' ) ) ) {
|
|
|
|
// Create an array of all the categories that are attached to posts.
|
2017-12-01 00:11:00 +01:00
|
|
|
$all_the_cool_cats = get_categories(
|
|
|
|
array(
|
|
|
|
'fields' => 'ids',
|
|
|
|
'hide_empty' => 1,
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
// We only need to know if there is more than one category.
|
|
|
|
'number' => 2,
|
|
|
|
)
|
|
|
|
);
|
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
|
|
|
|
|
|
|
// Count the number of categories that are attached to the posts.
|
|
|
|
$all_the_cool_cats = count( $all_the_cool_cats );
|
|
|
|
|
|
|
|
set_transient( 'twentyfifteen_categories', $all_the_cool_cats );
|
|
|
|
}
|
|
|
|
|
2017-01-27 23:09:42 +01:00
|
|
|
if ( $all_the_cool_cats > 1 || is_preview() ) {
|
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
|
|
|
// This blog has more than 1 category so twentyfifteen_categorized_blog should return true.
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
// This blog has only 1 category so twentyfifteen_categorized_blog should return false.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-11-25 21:57:24 +01:00
|
|
|
* Flush out the transients used in {@see twentyfifteen_categorized_blog()}.
|
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
|
|
|
|
*/
|
|
|
|
function twentyfifteen_category_transient_flusher() {
|
|
|
|
// Like, beat it. Dig?
|
|
|
|
delete_transient( 'twentyfifteen_categories' );
|
|
|
|
}
|
|
|
|
add_action( 'edit_category', 'twentyfifteen_category_transient_flusher' );
|
2017-12-01 00:11:00 +01:00
|
|
|
add_action( 'save_post', 'twentyfifteen_category_transient_flusher' );
|
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_post_thumbnail' ) ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Display an optional post thumbnail.
|
|
|
|
*
|
|
|
|
* Wraps the post thumbnail in an anchor element on index views, or a div
|
|
|
|
* element when on single views.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*/
|
|
|
|
function twentyfifteen_post_thumbnail() {
|
|
|
|
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
|
|
|
|
return;
|
|
|
|
}
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
if ( is_singular() ) :
|
|
|
|
?>
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
<div class="post-thumbnail">
|
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 the_post_thumbnail(); ?>
|
|
|
|
</div><!-- .post-thumbnail -->
|
|
|
|
|
|
|
|
<?php else : ?>
|
|
|
|
|
2014-11-04 19:57:27 +01:00
|
|
|
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
|
|
|
|
<?php
|
2014-11-17 19:25:23 +01:00
|
|
|
the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) );
|
2014-11-04 19:57:27 +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
|
|
|
</a>
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
<?php
|
|
|
|
endif; // End is_singular()
|
|
|
|
}
|
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;
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_get_link_url' ) ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Return the post URL.
|
|
|
|
*
|
|
|
|
* Falls back to the post permalink if no URL is found in the post.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @see get_url_in_content()
|
|
|
|
*
|
|
|
|
* @return string The Link format URL.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_get_link_url() {
|
|
|
|
$has_url = get_url_in_content( get_the_content() );
|
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
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
return $has_url ? $has_url : apply_filters( 'the_permalink', get_permalink() );
|
|
|
|
}
|
2014-11-04 22:19:22 +01:00
|
|
|
endif;
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_excerpt_more' ) && ! is_admin() ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Replaces "[...]" (appended to automatically generated excerpts) with ... and a 'Continue reading' link.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.0
|
|
|
|
*
|
|
|
|
* @return string 'Continue reading' link prepended with an ellipsis.
|
|
|
|
*/
|
|
|
|
function twentyfifteen_excerpt_more( $more ) {
|
|
|
|
$link = sprintf(
|
|
|
|
'<a href="%1$s" class="more-link">%2$s</a>',
|
|
|
|
esc_url( get_permalink( get_the_ID() ) ),
|
|
|
|
/* translators: %s: Name of current post */
|
|
|
|
sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
|
2014-11-04 22:19:22 +01:00
|
|
|
);
|
2017-12-01 00:11:00 +01:00
|
|
|
return ' … ' . $link;
|
|
|
|
}
|
|
|
|
add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
|
2014-11-04 22:19:22 +01:00
|
|
|
endif;
|
2016-03-10 06:37:27 +01:00
|
|
|
|
|
|
|
if ( ! function_exists( 'twentyfifteen_the_custom_logo' ) ) :
|
2017-12-01 00:11:00 +01:00
|
|
|
/**
|
|
|
|
* Displays the optional custom logo.
|
|
|
|
*
|
|
|
|
* Does nothing if the custom logo is not available.
|
|
|
|
*
|
|
|
|
* @since Twenty Fifteen 1.5
|
|
|
|
*/
|
|
|
|
function twentyfifteen_the_custom_logo() {
|
|
|
|
if ( function_exists( 'the_custom_logo' ) ) {
|
|
|
|
the_custom_logo();
|
|
|
|
}
|
2016-03-10 06:37:27 +01:00
|
|
|
}
|
|
|
|
endif;
|