Php 如何更改WordPress文章网格中的“阅读更多”文本

Php 如何更改WordPress文章网格中的“阅读更多”文本,php,wordpress,custom-post-type,Php,Wordpress,Custom Post Type,回到那一天,我需要更改post grid的read more文本,所以我使用了此代码,并且工作正常。 function excerpt_read_more_link($output) { global $post; return $output . '<a class="more-link" href="'. get_permalink($post->ID) . '">voir plus</a>'; } add_filter(

回到那一天,我需要更改post grid的read more文本,所以我使用了此代码,并且工作正常。

function excerpt_read_more_link($output) {
global $post;
return $output . '<a class="more-link" href="'. get_permalink($post->ID) . '">voir plus</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');

这里是我的解决方案,以防有人有同样的问题

函数摘录\u读取\u更多\u链接($output){
全球$员额;
$li=获取字段(“bouton_personnalise”);
$text='Lire plus';
如果(isset($li))
$text=$li;
返回$output。“;
}
添加过滤器(“摘录”、“摘录”和“阅读”链接);
function excerpt_read_more_link($output) {
    global $post;
    $text = 'voir plus';
    if ( isset('bouton_personnalise'))  

        $text = 'bouton_personnalise';
    return $output . '<a class="more-link" href="'. get_permalink($post->ID) . '">'. $text .'</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');