- functions.phpに↓を追加する方法(50文字)
123456// 抜粋記事の文字数function new_excerpt_mblength($length) {return 50;}add_filter('excerpt_mblength', 'new_excerpt_mblength'); - もしくは、直接テーマ内の(php)<?php the_excerpt(); ?>を編集する方法(50文字)
1<?php echo mb_substr(get_the_excerpt(), 0, 50); ?>
タイトルの文字数を調整する方法
テーマ内の(php) <?php the_title(); ?>を↓に置き換えます。(15文字)
1 |
<?php $title= mb_substr($post->post_title,0,15); echo $title; ?> |
コメントを残す