0
WordPressプラグインで 'Read More'を修正して、デフォルトの投稿と同じではなく特定のページにリンクしようとしています。この場合は、お客様の声の一部です。特定のWordPressページにリンクするために 'read more'テキストをPHPに変更する
私はテーマfunctions.php
ファイルの末尾に次のコードを追加して、$more_text
変数を変更する命令を設置しているが、私はページIDまたはURLを追加すべき場所を確認していない、それが既存のいずれかを交換する必要がある場合スニペット。これはコードです
function hg_testimonial_rotator_the_excerpt($html, $limit)
{
$more_text = '... <a class="read-more" href="'.get_permalink(get_the_ID()).'">Read the Rest...</a>';
return wp_trim_words(get_the_excerpt(), $limit, $more_text);
}
add_filter('testimonial_rotator_the_excerpt', 'hg_testimonial_rotator_the_excerpt', 10, 2);
ご意見はありますか?
ありがとう、それは私が必要としたものです。 – catwingz