Reply To: Translation of "Read more" link

Home Forums Support Translation of "Read more" link Reply To: Translation of "Read more" link

Home Forums Support Translation of "Read more" link Reply To: Translation of "Read more" link

#91750
Tom
Lead Developer
Lead Developer

Got it, here’s the code that ended up working for you:

if ( ! function_exists( 'generate_translate_excerpt_more' ) ) :
/**
 * Prints the read more HTML to post excerpts
 */
	add_filter( 'excerpt_more', 'generate_translate_excerpt_more', 100 );
	function generate_translate_excerpt_more( $more ) {
		return ' ... <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read more', 'generate') . '</a>';
	}
endif;

if ( ! function_exists( 'generate_translate_content_more' ) ) :
/**
 * Prints the read more HTML to post content using the more tag
 */
	add_filter( 'the_content_more_link', 'generate_translate_content_more', 100 );
	function generate_translate_content_more( $more ) {
		return '<p><a class="read-more content-read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read more', 'generate') . '</a></p>';
	}
endif;