1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | //echo mb_substr(get_the_excerpt(),0, 240);の...を変える function new_excerpt_more( $more ) { return '...' ; } add_filter( 'excerpt_more' , 'new_excerpt_more' ); //抜粋文字数指定 マルチバイトパッチ必要 function change_excerpt_mblength( $length ) { return 111; } add_filter( 'excerpt_mblength' , 'change_excerpt_mblength' ); unction.phpに以下のコードを追加しますと、「続きを読む」などのリンクに変更 function new_excerpt_more( $post ) { return '<a href="' . get_permalink( $post ->ID) . '">' . '...続きを読む' . '</a>' ; } add_filter( 'excerpt_more' , 'new_excerpt_more' ); オリジナル //抜粋カスタマイズ function new_excerpt_more( $post ) { return '...<div class="blog_more"><a href="' . get_permalink( $post ->ID) . '">' . '続きを読む<img draggable="false" role="img" class="emoji" alt=" . '</a></div>' ; } add_filter( 'excerpt_more' , 'new_excerpt_more' ); |