【发布时间】:2013-12-19 02:36:00
【问题描述】:
我正在使用一个主题,该主题使用以下函数来设置所有页面上的帖子摘录长度:
//excerpt length
if ( !function_exists('custom_excerpt_length')):
function custom_excerpt_length( $length ) {
return 90;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function new_excerpt_more( $more ) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
endif;
我添加了新功能:
add_filter( 'get_the_excerpt', 'so20668477_get_the_excerpt', 10, 1 );
function so20668477_get_the_excerpt( $excerpt )
{
if( is_page( 39370 ) )
$excerpt = apply_filters( 'the_content', get_the_content() );
return $excerpt;
}
但是,它不起作用,仍然在第 39370 页上显示帖子摘录。我只需要在页面 ID = 39370 上显示完整的帖子。不知道如何添加条件。任何帮助深表感谢。
【问题讨论】: