2011-04-21 80 views

回答

0

您可以添加条件语句来测试特定网页ID:

if(is_page('<your page id>')){ 
    // Do your thing 
} 

同样,你可以测试一个特定的页面模板,像这样:

if(is_page_template('<page template file name>']){ 
    // Go on wit' you bad self 
} 

确保当你使用is_page_template()为其提供模板的文件名,例如is_page_template('two-columns.php'),而不是模板的名称,例如is_page_template('Two Columns')

+0

谢谢, 我要去检查这种方式... – 2011-04-23 16:18:49