RSSフィードの抜粋の文字数変更
-
お世話になっております。
RSS2.0フィードの抜粋の文字数変更をしたいのですが、
できないためご指導下さい。RSSフィードの下記に表示される「○○○」の文字数の変更をしたいです。
<description>
<![CDATA[ ○○○○○○○○○○○○ … ]]>
</description>feed-rss2.phpファイルを
wp-includes>feed-rss2.php
から
wp-content>themes>使用中のテーマ>feed-rss2.php
へコピーして編集しています。出力部分は
==========================================================
<?php if (get_option(‘rss_use_excerpt’)) : ?>
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
<?php else : ?>
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
==========================================================
になると思うのですが、function.phpに
=============================================================
add_filter( ‘the_excerpt_rss’, ‘mytheme_the_excerpt_rss’ );function mytheme_the_excerpt_rss( $out ) {
if ( mb_strlen( $out ) > 100 )
$out = mb_substr( $out, 0, 100 ).'[…]’;
return $out;
}
=============================================================
と記述したのですが、文字数が変更されません。何卒、ご指導、よろしくお願い致します。
- トピック「RSSフィードの抜粋の文字数変更」には新たに返信することはできません。