我想删除摘录功能或呈现它无功能,因为我希望所有的职位被充分查看其内容。我认为这个主题有一些跟踪,以确保摘录是在那一行,所以它必须存在。wordpress主题摘录功能消除thao工作室主题
function excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
return $excerpt;
}
function content($limit) {
$content = explode(' ', get_the_content(), $limit);
if (count($content)>=$limit) {
array_pop($content);
$content = implode(" ",$content).'...';
} else {
$content = implode(" ",$content);
}
$content = preg_replace('/\[.+\]/','', $content);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
return $content;
}
我只有这2行代码,我知道是相关的。 我不知道$限制来自哪里,我试图找到所有主题相关的PHP,没有发现。 请帮帮我。非常感谢你。
你想显示完整的内容,而不是你的主题摘录? – 2012-07-15 18:38:58
是的,如果可能的话。我试图尽可能长时间地做出摘录,以便它显示完整但失败 – 2012-07-15 18:40:48
为什么不在主题中使用the_content()? – 2012-07-15 18:41:48