Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Custom template tags for this theme
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Twenty_One
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twenty_twenty_one_posted_on' ) ) {
|
|
|
|
/**
|
|
|
|
* Prints HTML with meta information for the current post-date/time.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function twenty_twenty_one_posted_on() {
|
|
|
|
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
|
|
|
|
|
|
|
$time_string = sprintf(
|
|
|
|
$time_string,
|
|
|
|
esc_attr( get_the_date( DATE_W3C ) ),
|
|
|
|
esc_html( get_the_date() )
|
|
|
|
);
|
|
|
|
echo '<span class="posted-on">';
|
|
|
|
printf(
|
|
|
|
/* translators: %s: publish date. */
|
|
|
|
esc_html__( 'Published %s', 'twentytwentyone' ),
|
|
|
|
$time_string // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
);
|
|
|
|
echo '</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twenty_twenty_one_posted_by' ) ) {
|
|
|
|
/**
|
|
|
|
* Prints HTML with meta information about theme author.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function twenty_twenty_one_posted_by() {
|
|
|
|
if ( ! get_the_author_meta( 'description' ) && post_type_supports( get_post_type(), 'author' ) ) {
|
|
|
|
echo '<span class="byline">';
|
|
|
|
printf(
|
|
|
|
/* translators: %s author name. */
|
|
|
|
esc_html__( 'By %s', 'twentytwentyone' ),
|
|
|
|
'<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="author">' . esc_html( get_the_author() ) . '</a>'
|
|
|
|
);
|
|
|
|
echo '</span>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twenty_twenty_one_entry_meta_footer' ) ) {
|
|
|
|
/**
|
|
|
|
* Prints HTML with meta information for the categories, tags and comments.
|
|
|
|
* Footer entry meta is displayed differently in archives and single posts.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function twenty_twenty_one_entry_meta_footer() {
|
|
|
|
|
|
|
|
// Early exit if not a post.
|
|
|
|
if ( 'post' !== get_post_type() ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide meta information on pages.
|
|
|
|
if ( ! is_single() ) {
|
|
|
|
|
Twenty Twenty: Import the latest changes from GitHub
For a full list of changes since [49216], see https://github.com/WordPress/twentytwentyone/compare/dfe141276ca4b856bbcd748f9da108ddad026c4c...trunk/.
Props poena, melchoyce, luminuu, aristath, jffng, ryelle, kishanjasani, rolfsiebers, sresok, desrosj.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49247
git-svn-id: http://core.svn.wordpress.org/trunk@49009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 20:26:06 +02:00
|
|
|
if ( is_sticky() ) {
|
2020-11-12 19:36:15 +01:00
|
|
|
echo '<p>' . esc_html_x( 'Featured post', 'Label for sticky posts', 'twentytwentyone' ) . '</p>';
|
Twenty Twenty: Import the latest changes from GitHub
For a full list of changes since [49216], see https://github.com/WordPress/twentytwentyone/compare/dfe141276ca4b856bbcd748f9da108ddad026c4c...trunk/.
Props poena, melchoyce, luminuu, aristath, jffng, ryelle, kishanjasani, rolfsiebers, sresok, desrosj.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49247
git-svn-id: http://core.svn.wordpress.org/trunk@49009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 20:26:06 +02:00
|
|
|
}
|
|
|
|
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
$post_format = get_post_format();
|
|
|
|
if ( 'aside' === $post_format || 'status' === $post_format ) {
|
|
|
|
echo '<p><a href="' . esc_url( get_permalink() ) . '">' . twenty_twenty_one_continue_reading_text() . '</a></p>'; // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
}
|
|
|
|
|
|
|
|
// Posted on.
|
|
|
|
twenty_twenty_one_posted_on();
|
|
|
|
|
|
|
|
// Edit post link.
|
|
|
|
edit_post_link(
|
|
|
|
sprintf(
|
|
|
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
|
|
|
esc_html__( 'Edit %s', 'twentytwentyone' ),
|
|
|
|
'<span class="screen-reader-text">' . get_the_title() . '</span>'
|
|
|
|
),
|
|
|
|
'<span class="edit-link">',
|
|
|
|
'</span><br>'
|
|
|
|
);
|
|
|
|
|
|
|
|
if ( has_category() || has_tag() ) {
|
|
|
|
|
|
|
|
echo '<div class="post-taxonomies">';
|
|
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
|
$categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
|
|
|
|
if ( $categories_list ) {
|
|
|
|
printf(
|
|
|
|
/* translators: %s: list of categories. */
|
2020-10-27 03:00:07 +01:00
|
|
|
'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
|
$tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
|
|
|
|
if ( $tags_list ) {
|
|
|
|
printf(
|
|
|
|
/* translators: %s: list of tags. */
|
2020-10-27 03:00:07 +01:00
|
|
|
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
);
|
|
|
|
}
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
echo '<div class="posted-by">';
|
|
|
|
// Posted on.
|
|
|
|
twenty_twenty_one_posted_on();
|
|
|
|
// Posted by.
|
|
|
|
twenty_twenty_one_posted_by();
|
|
|
|
// Edit post link.
|
|
|
|
edit_post_link(
|
|
|
|
sprintf(
|
|
|
|
/* translators: %s: Name of current post. Only visible to screen readers. */
|
|
|
|
esc_html__( 'Edit %s', 'twentytwentyone' ),
|
|
|
|
'<span class="screen-reader-text">' . get_the_title() . '</span>'
|
|
|
|
),
|
|
|
|
'<span class="edit-link">',
|
|
|
|
'</span>'
|
|
|
|
);
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
if ( has_category() || has_tag() ) {
|
|
|
|
|
|
|
|
echo '<div class="post-taxonomies">';
|
|
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
|
$categories_list = get_the_category_list( __( ', ', 'twentytwentyone' ) );
|
|
|
|
if ( $categories_list ) {
|
|
|
|
printf(
|
|
|
|
/* translators: %s: list of categories. */
|
|
|
|
'<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
|
|
|
|
$categories_list // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* translators: used between list items, there is a space after the comma. */
|
|
|
|
$tags_list = get_the_tag_list( '', __( ', ', 'twentytwentyone' ) );
|
|
|
|
if ( $tags_list ) {
|
|
|
|
printf(
|
|
|
|
/* translators: %s: list of tags. */
|
|
|
|
'<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
|
|
|
|
$tags_list // phpcs:ignore WordPress.Security.EscapeOutput
|
|
|
|
);
|
|
|
|
}
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twenty_twenty_one_post_thumbnail' ) ) {
|
|
|
|
/**
|
|
|
|
* Displays an optional post thumbnail.
|
|
|
|
*
|
|
|
|
* Wraps the post thumbnail in an anchor element on index views, or a div
|
|
|
|
* element when on single views.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function twenty_twenty_one_post_thumbnail() {
|
|
|
|
if ( ! twenty_twenty_one_can_show_post_thumbnail() ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php if ( is_singular() ) : ?>
|
|
|
|
|
|
|
|
<figure class="post-thumbnail">
|
|
|
|
<?php
|
|
|
|
// Thumbnail is loaded eagerly because it's going to be in the viewport immediately.
|
|
|
|
the_post_thumbnail( 'post-thumbnail', array( 'loading' => 'eager' ) );
|
|
|
|
?>
|
|
|
|
</figure><!-- .post-thumbnail -->
|
|
|
|
|
|
|
|
<?php else : ?>
|
|
|
|
|
|
|
|
<figure class="post-thumbnail">
|
|
|
|
<a class="post-thumbnail-inner alignwide" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1">
|
|
|
|
<?php the_post_thumbnail( 'post-thumbnail' ); ?>
|
|
|
|
</a>
|
|
|
|
</figure>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! function_exists( 'twenty_twenty_one_the_posts_navigation' ) ) {
|
|
|
|
/**
|
|
|
|
* Print the next and previous posts navigation.
|
|
|
|
*
|
|
|
|
* @since 1.0.0
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function twenty_twenty_one_the_posts_navigation() {
|
2020-11-12 19:36:15 +01:00
|
|
|
$post_type = get_post_type_object( get_post_type() );
|
|
|
|
$post_type_name = '';
|
|
|
|
if (
|
|
|
|
is_object( $post_type ) &&
|
|
|
|
property_exists( $post_type, 'labels' ) &&
|
|
|
|
is_object( $post_type->labels ) &&
|
|
|
|
property_exists( $post_type->labels, 'name' )
|
|
|
|
) {
|
|
|
|
$post_type_name = $post_type->labels->name;
|
|
|
|
}
|
|
|
|
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
the_posts_pagination(
|
|
|
|
array(
|
|
|
|
/* translators: There is a space after page. */
|
|
|
|
'before_page_number' => esc_html__( 'Page ', 'twentytwentyone' ),
|
|
|
|
'mid_size' => 0,
|
|
|
|
'prev_text' => sprintf(
|
|
|
|
'%s <span class="nav-prev-text">%s</span>',
|
|
|
|
is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ),
|
2020-11-12 19:36:15 +01:00
|
|
|
sprintf(
|
|
|
|
/* translators: %s: The post-type name. */
|
|
|
|
esc_html__( 'Newer %s', 'twentytwentyone' ),
|
|
|
|
'<span class="nav-short">' . esc_html( $post_type_name ) . '</span>'
|
|
|
|
)
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
),
|
|
|
|
'next_text' => sprintf(
|
|
|
|
'<span class="nav-next-text">%s</span> %s',
|
2020-11-12 19:36:15 +01:00
|
|
|
sprintf(
|
|
|
|
/* translators: %s: The post-type name. */
|
|
|
|
esc_html__( 'Older %s', 'twentytwentyone' ),
|
|
|
|
'<span class="nav-short">' . esc_html( $post_type_name ) . '</span>'
|
|
|
|
),
|
Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!
Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.
Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.
Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216
git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:10 +02:00
|
|
|
is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' )
|
|
|
|
),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|