mirror of https://github.com/vtrois/kratos
feat: add custom excerpt length (#397)
parent
8fc242c8fe
commit
b5c76af8a1
|
@ -93,11 +93,11 @@ function get_post_views($echo = 1)
|
|||
}
|
||||
|
||||
// 文章列表简介内容
|
||||
function excerpt_length($length)
|
||||
function custom_excerpt_length($length)
|
||||
{
|
||||
return 260;
|
||||
return kratos_option('g_excerpt_length', '260');
|
||||
}
|
||||
add_filter('excerpt_length', 'excerpt_length');
|
||||
add_filter('excerpt_length', 'custom_excerpt_length');
|
||||
|
||||
// 开启特色图
|
||||
add_theme_support("post-thumbnails");
|
||||
|
|
|
@ -176,6 +176,13 @@ CSF::createSection($prefix, array(
|
|||
'subtitle' => __('启用/禁用 Gutenberg 编辑器', 'kratos'),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'id' => 'g_excerpt_length',
|
||||
'type' => 'text',
|
||||
'title' => __('文章简介缩略', 'kratos'),
|
||||
'subtitle' => __('文章简介显示的字符数量', 'kratos'),
|
||||
'default' => '260',
|
||||
),
|
||||
array(
|
||||
'id' => 'g_renameother_fieldset',
|
||||
'type' => 'fieldset',
|
||||
|
|
Loading…
Reference in New Issue