php 更改默认的Genesis阅读更多链接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 更改默认的Genesis阅读更多链接相关的知识,希望对你有一定的参考价值。

<?php
add_filter( 'get_the_content_more_link', 'prefix_change_more_link_text' );
/**
 * Replaces the default Genesis [Read More...] with Read More.
 *
 * @param string $more_link The content more link.
 *
 * @return string
 */
function prefix_change_more_link_text( $more_link ) {

	$new_more_link_text = __( 'Read More', 'child-theme-text-domain' );

	return sprintf( '&hellip; <a href="%s" class="more-link">%s</a>',
		get_the_permalink(),
		genesis_a11y_more_link( $new_more_link_text )
	);
}

以上是关于php 更改默认的Genesis阅读更多链接的主要内容,如果未能解决你的问题,请参考以下文章