好的,我已经创建了自己的函数来检查真/假条件。这似乎奏效了。你觉得怎么样?
function is_this_afield() {
global $wp_query;
$postid = $wp_query->post->ID;
if (get_post_meta($postid, \'flatme\', true)) {
return true;
} elseif(is_page_template(\'template-flat.php\')) {
return true;
}else {
return false;
}
wp_reset_postdata();
}
function flatsome_scripts()
{
if(is_this_afield()) {
wp_enqueue_style( \'flatsome-icons\', get_template_directory_uri() .\'/flatme/css/fonts.css\', array(), \'2.1\', \'all\' );
}
}
add_action( \'wp_enqueue_scripts\', \'flatsome_scripts\' );