从某些模板页面上的摘录中删除“继续阅读”

时间:2012-02-09 17:11:51

标签: wordpress

在以下开发网站上,我有一个主要产品(自定义帖子类型)页面:

http://keg.brettatkin.com/products/

我想在此页面上阅读“阅读更多”。

当我点击某个特定产品时,我使用摘录作为基本产品说明,并且不希望显示“阅读更多”。

http://keg.brettatkin.com/products/creating-compelling-communication/

我有产品说明页面的自定义模板。如何从此模板页面中删除“阅读更多”?

由于

布雷特

1 个答案:

答案 0 :(得分:2)

查看主题的functions.php文件,查找以。开头的行。

add_filter('excerpt_more',

它将有2个参数,看起来类似于

add_filter('excerpt_more', 'new_excerpt_more');

第二个参数是打印“read more”的函数,因此在这种情况下查找函数'new_excerpt_more'并返回'';在函数声明之后。

function new_excerpt_more()
{

    if(is_page('excerpts') return "";

    // old code here 

}