如何更改read more帖子类别中的帖子链接文本?此外,如何更改相关的帖子文本及其阅读更多按钮参考的帖子图像
我试着在postingle.php和funtions.php 中添加代码
// Customizes read more link in excerpts
function new_excerpt_more($more) {
global $post;
return ‘ <strong> … on the edge of your seat? Read more! </strong> ‘; //you
can change this text to whatever you like
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
根据您所显示的内容,您的代码片段将适用于默认的read more,在codex中显示为Classic。
看看你的代码片段怎么没有显示在按钮上?
让我们试试这个。
function new_excerpt_more($more) {
global $post;
return ' <a class="moretag btn btn-primary" href="'. get_permalink($post->ID) . '">Read More »</a>'; //Change to suit your needs
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
这至少会让您达到可以调试的程度,但需要注意的是,它可能是非常特定于主题的。一个URL,如果你能提供它可以帮助很多。