wp_enqueue_style仅有条件地为单数组(post类型)添加

时间:2013-03-23 15:26:54

标签: wordpress styles

我正在尝试使用is_singular(array())将某个帖子类型的样式排入队列但是当我定义post类型static时它会起作用,当我使用get_option添加它时它不起作用。

这是我的代码。

// load front end scripts
function rm_scripts() {

    $types = new review_media_system;
    $ptpys = $types->rm_allow_types();

    echo $ptpys;

    if(!is_admin()){
       wp_enqueue_style('rm-stylesheet', RM_URL.'css/rm-style.css',null, 1);

       if(is_singular(array($ptpys))){
            wp_enqueue_style('rm-admin_gallery_css', RM_URL.'css/responsiveslides.css',null, 1);                    
       }
    }    

}
add_action('wp_enqueue_scripts', 'rm_scripts');

0 个答案:

没有答案