页面数组只在第一个类上加载脚本

时间:2015-02-12 00:42:11

标签: php wordpress

知道为什么这只是在第一个课程brand而不是home上加载脚本?

<?php
if ( is_user_logged_in() ) {
    //nothing to do here

} if ( is_page( array( 'brand-contact', 'home' ) ) ) { ?>
    //script goes here

<?php } ?>

1 个答案:

答案 0 :(得分:1)

is_page('home')不是您正在寻找的功能。请尝试使用is_home()

if ( is_page('brand-contact') || is_home() ) { ?>
    //script goes here

<?php }
相关问题