2013-03-14 80 views
0

我在我的custom_functions.php中设置了一个自定义循环。循环的基本思路是这样的显示重复内容的WordPress自定义循环

function category() { 
    if (is_category(3557)) { 
     News Category content 
    } 
    else{ 
     Main categories content 
    } 
} 

也能正常工作的所有主要类别,但新闻页面上我展示新闻内容,然后在主网站内容。

+0

你的代码是断章取义的,但如果你的“新闻”类别是3557然后在'news'category archive page only that the first part that that should run,not both。我认为问题在别处。 – 2013-03-14 18:17:17

回答

0

我意识到什么是错的 - 我与论文主题的工作,我如何开始一个自定义的循环中发现的例子有

else 
    thesis_loop::category(); 

末。但是,一旦我说实际内容覆盖默认的循环,我只是需要加入括号内为else语句,所以就成了

else { 
    Main category content 
}