【发布时间】:2018-09-25 08:21:02
【问题描述】:
我正在尝试更改帖子摘录上阅读更多按钮的功能。我希望它不是将阅读更多按钮转到文章页面,而是将文章的其余部分加载到存档页面上。
这是我的功能页面中的内容:
function new_excerpt_more($more) {
global $post;
return '... <a href="'. get_permalink($post->ID) . '">Read more</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
function custom_excerpt_length( $length ) {
return 250;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
我知道我必须用其他东西替换get_permalink($post->ID),但我不知道该怎么做。任何帮助将不胜感激。
【问题讨论】:
标签: php html wordpress wordpress-theming