Open "Continue Reading" in New Tab with Twenty Sixteen Child Theme
-
I have created a child theme of the Twenty Sixteen theme, and I want to make the “Continue Reading” button open in a new tab. It seems like it should be straightforward, but I can’t seem to find any place to put the appropriate code that actually works. I edited “template-tags.php” and added the target code, but it didn’t do anything.
Here’s the chunk of modified code:
if ( ! function_exists( 'twentysixteen_excerpt_more' ) && ! is_admin() ) : /** * Replaces "[...]" (appended to automatically generated excerpts) with ... and * a 'Continue reading' link. * * Create your own twentysixteen_excerpt_more() function to override in a child theme. * * @since Twenty Sixteen 1.0 * * @return string 'Read More' link prepended with an ellipsis. */ function twentysixteen_excerpt_more() { $link = sprintf( '<a target="_blank" href="%1$s" class="more-link">%2$s</a>', esc_url( get_permalink( get_the_ID() ) ), /* translators: %s: Name of current post */ sprintf( __( 'Read More', 'twentysixteen' ), get_the_title( get_the_ID() ) ) ); return ' … ' . $link; } add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); endif;
And, here’s a link to the site: https://thelittlethingsdiy.com
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Open "Continue Reading" in New Tab with Twenty Sixteen Child Theme’ is closed to new replies.