updated theme Twenty Nineteen
version 2.0
This commit is contained in:
@ -204,6 +204,30 @@ function twentynineteen_widgets_init() {
|
||||
}
|
||||
add_action( 'widgets_init', 'twentynineteen_widgets_init' );
|
||||
|
||||
/**
|
||||
* Replaces "[...]" (appended to automatically generated excerpts) with ... and
|
||||
* a 'Continue reading' link.
|
||||
*
|
||||
* @since Twenty Nineteen 2.0
|
||||
*
|
||||
* @param string $link Link to single post/page.
|
||||
* @return string 'Continue reading' link prepended with an ellipsis.
|
||||
*/
|
||||
function twentynineteen_excerpt_more( $link ) {
|
||||
if ( is_admin() ) {
|
||||
return $link;
|
||||
}
|
||||
|
||||
$link = sprintf(
|
||||
'<p class="link-more"><a href="%1$s" class="more-link">%2$s</a></p>',
|
||||
esc_url( get_permalink( get_the_ID() ) ),
|
||||
/* translators: %s: Post title. */
|
||||
sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentynineteen' ), get_the_title( get_the_ID() ) )
|
||||
);
|
||||
return ' … ' . $link;
|
||||
}
|
||||
add_filter( 'excerpt_more', 'twentynineteen_excerpt_more' );
|
||||
|
||||
/**
|
||||
* Set the content width in pixels, based on the theme's design and stylesheet.
|
||||
*
|
||||
|
Reference in New Issue
Block a user