SO网友:Jerome D. Dizon
请尝试以下操作:
将此添加到主题函数中。php
function everydaytherapy_script_enqueue() {
if( is_page_template(\'pagetemplate-this.php\') && is_page_template(\'pagetemplate-that.php\') && is_page_template(\'pagetemplate-other.php\') ) {
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'https://d1azc1qln24ryf.cloudfront.net/47089/SocialIconsNCD/style-cf.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'/css/baile.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'/css/consolidated-0.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_script(\'customjs\', get_template_directory_uri() . \'/js/javascript.js\', array() \'1.0.0\', bool $in_true);
}
add_action( \'wp_enqueue_scripts\', \'everydaytherapy_script_enqueue\' );
http://codex.wordpress.org/Function_Reference/is_page_template
或使用is\\u page-“page\\u ID”:
https://developer.wordpress.org/reference/functions/is_page/
function everydaytherapy_script_enqueue() {
if ( is_page( array( \'about\', \'services\', \'contact\') )) {
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'https://d1azc1qln24ryf.cloudfront.net/47089/SocialIconsNCD/style-cf.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'/css/baile.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_style(\'customstyle\', get_template_directory_uri() . \'/css/consolidated-0.css\', array(), \'1.0.0\', \'all\');
wp_enqueue_script(\'customjs\', get_template_directory_uri() . \'/js/javascript.js\', array() \'1.0.0\', bool $in_true);
}
add_action( \'wp_enqueue_scripts\', \'everydaytherapy_script_enqueue\' );
让我知道这是否有效。