想知道如何在搜索中只返回摘录。
function get_the_excerpt( $deprecated = \'\' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, \'2.3\' );
$post = get_post();
if ( empty( $post ) ) {
return \'\';
}
if ( post_password_required() ) {
return __( \'There is no excerpt because this is a protected post.\' );
}
/**
* Filter the retrieved post excerpt.
*
* @since 1.2.0
*
* @param string $post_excerpt The post excerpt.
*/
return apply_filters( \'get_the_excerpt\', $post->post_excerpt );
}
我是否将此函数放在搜索循环中?