0
我从一个静态站点创建我的第一个wordpress主题,该站点由CDN提供的Boostrap运行。使用最新的Boostrap通过Wordpress通过MAXCDN交付
请不要有任何建议来下载此项目的boostrap,它需要通过CDN交付。
我想通过CDN使用我的functions.php文件加载boostrap,而不是加载它只是显示在加载页面的顶部的文本(没有任何明显的检查员pannel和没有错误消息它只是似乎显示来自functions.php的信息作为文本)。
我已经包含在header.php中
所有的functions.php中码<?php wp_head(); ?>
:
function my_scripts_enqueue() {
wp_register_script('bootstrap-js', '://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', array('jquery'), NULL, true);
wp_register_script('gajax-js', '://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js', array('jquery'), NULL, true);
wp_register_style('bootstrap-css', '://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', false, NULL, 'all');
wp_register_style('fontawsome-css', '://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', false, NULL, 'all');
wp_enqueue_script('bootstrap-js');
wp_enqueue_script('gajax-js');
wp_enqueue_style('bootstrap-css');
wp_enqueue_style('fontawsome-css');
}
add_action('wp_enqueue_scripts', 'my_scripts_enqueue');