WordPress页面添加摘要

文章描述:

WordPress如何给页面添加摘要功能

自定义

functions.php

add_action(\'init\', \'page_excerpt\');
function page_excerpt() {
    add_post_type_support(\'page\', array(\'excerpt\'));
}

 

主题

page.php

if( has_excerpt() ){
    the_excerpt();
}

 

© 版权声明
THE END
点赞0打赏 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容