我有下面的代码
add_action('the_excerpt','limit_the_content');
function limit_the_content($content){
$settings = get_option('mytheme_options');
$word_limit = $settings['numberofwordsexcerpt'];
$words = explode(' ', $content);
return implode(' ', array_slice($words, 0, $word_limit));
}
add_action('the_excerpt_slider','limit_the_content_slider');
function limit_the_content_slider($content_slider){
$settings = get_option('mytheme_options');
$word_limit_slider = $settings['numberofwordsexcerptslider'];
$words_slider = explode(' ', $content_slider);
return implode(' ', array_slice($words_slider, 0, $word_limit_slider));
}
我正在尝试触发 index.php 中的第二个函数
<?php the_excerpt_slider(); ?>
我得到了错误:
Fatal error: Call to undefined function the_excerpt_slider() in
我触发它的第一个效果很好
<?php the_excerpt(); ?>
请帮我。